How to calculate the amount of VLOOKUP with two criteria?

I am looking for a clean (er) way (than to use SUMIFwith the third row) to calculate the sum of the results, for example VLOOKUP, which checks both the first and second row for the matching criteria.

So, given the transaction table, I would like to generate data in the report spreadsheet, ignoring at the moment how I determine which client / account combinations are relevant in the report spreadsheet by summing the values ​​in the transactions that this client and account have record.

Deals

CLIENT         | ACCOUNT        | VALUE
---------------|----------------|----------------
001            | 001            |  25.00
001            | 001            |   5.00
001            | 002            |  10.00
002            | 002            |  23.00
002            | 002            |   6.00
003            | 001            |   5.00
003            | 001            |   1.25
003            | 001            | 204.00
003            | 003            |  14.00

Report

CLIENT         | ACCOUNT        | TOTAL
---------------|----------------|----------------
001            | 001            |  30.00
001            | 002            |  10.00
002            | 002            |  29.00
003            | 001            | 210.25
003            | 003            |  14.00
+4
source share
2 answers

QUERY:

=QUERY(Transactions!A:C,"select A, B, sum(C) group by A, B label sum(C) 'TOTAL'",0)

+15

, -, , , .

SUMIFS

SUMIFS - , . SUMIF . , - Report!C1 (, Report!1:1 - ):

=SUMIFS(Transactions!$C:$C,Transactions!$A:$A,$A1,Transactions!$B:$B,$B1)
+1

Source: https://habr.com/ru/post/1523749/


All Articles