Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Using comma-separated value for looping through data with sumifs/vlookup

I have a Google Sheet, where I have a lot of raw book-keeping data with "accounts" as an identifier.

Now I want to make "sum rows" in another sheet, where I keep a list of accounts in a cell as a comma-separated value. What I want is for this comma-separated value to be looped for all the "raw data" and then have the amount from the bookkeeping of ALL entries for these accounts summed.

Example:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

RAW DATA:

A B
1000 1.25
1000 1.75
1000 100.22
2422 29.00
2400 20.00

Sum sheet:

A B
1000,2400 123.22
2422 29.00
2400,2422 49.00

I have tried with the following formula, but it doesnt seem to sum all of the accounts – only the first one in each comma-separated list.

=ArrayFormula(SUMPRODUCT(SUMIFS(Accounts!F:F;Accounts!A:A;TRIM(MID(SUBSTITUTE(A2;",";REPT(" ";9999));(ROW($BB$1:INDEX($BB:$BB;LEN(A2)-LEN(SUBSTITUTE(A2;",";""))+1))-1)*9999+1;9999))))))

>Solution :

For example:

enter image description here

Formula in E1:

=SUMPRODUCT((A:A=SPLIT(D1,","))*(B:B))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading