简体   繁体   中英

Google Sheets Array Formula how to specify which columns to increment and which not to?

I have a google sheet with & columns: ,User,Purchase,Date,billing date which is being populated from a google form. I want the sum of pending expenses for each user. Billing date is also specific to user.

So far, I populate column F with last billing date with =MAX(FILTER(D:D, A:A = E2)) and then use this for calculating the pending bill using =IFError(SUM(Filter(C2:C,B2:B>F2,A2:A=E2) ),0)

How do I calculate column F and G using Array Formula?
Link to google sheet: https://docs.google.com/spreadsheets/d/1g6zHXq_p5yX_6vlco1hTyWWt6eC_wSP-9AI5iLWZNnA/edit?usp=sharing

You need to have a look at the fantastic Query function .

Something similar to this seems to work: =QUERY(A2:D,"select A, max(D), sum(C) group by A") but you will need to nest two queries to get your desired result with the sum.

(note though that in your sheet, you are showing a value for last bill even if a bill hasn't been sent)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM