How Can I Use a Google Spreadsheet Query to Sum Rows in Another Sheet
I Have a Google Spreadsheet That Spans 3 (Work)Sheets. on the First Page I Have a Set of Rows with Customer Data. That Looks Like C D E Joe - 100 Bob - 200 Joe...
I have a Google Spreadsheet that spans 3 (work)Sheets. On the first page I have a set of rows with customer data.
That looks like
C D E
Joe - 100
Bob - 200
Joe - 300
Jane - 50
And on sheet 2 I have a column with a formula that attempts to query those values and sum the purchase values for each customer (col E).
The formula I tried to use which fails is:
"=(QUERY('data'!B40:E60, "Select C, Sum(E) where C contains """&A18&""" Pivot C"))
In all seriousness though I really don't care about selecting C this is just the 20th variation I tried. What I am trying to do is sum E for all rows where C matches the cell A18 which is the customer name on sheet 2.
2 Answers
Try:
=QUERY('data'!B40:E60, "Select C, Sum(E) where C = '"&A18&"' group by C")
and see if that works ?
Column A: Name , Column B: Amount
=QUERY(A1:B,"select A,sum(B) group by (A)")