• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sum multiple columns based on multiple (lots of) categories

OgliBeta

New Member
The formula needs to find a certain row and then sum select columns from the dataset. There will only be one row criteria, but multiple column criteria (approx. 20). Each column criteria is listed in a separate cell, though if necessary or easier for the formula I could have all the criteria in one cell separated by commas.
Is there a formula that works like SUMIFS only sums across columns instead of down rows?

The sample workbook is a small example of the result I'm needing.
 

Attachments

  • Sample File.xlsx
    10.6 KB · Views: 3
Try.....

In G14, enter with Ctrl+Shift+Enter, copied across and down :

=SUM(VLOOKUP($F14,$A$3:$H$8,IF(1,MATCH(G$11:IF(G$13="",G$12,G$13),$B$2:$H$2,0)+1),0))

Regards
Bosco
 

Attachments

  • Sample File(Vlookup).xlsx
    11.7 KB · Views: 9
That works good for the sample file, but I'm not sure how to translate that into my much larger working file...

I've tweaked the sample file to have 20 column criteria which is the number I have in my actual file.

Is it still doable?
 

Attachments

  • Sample File.xlsx
    11.3 KB · Views: 2
That works good for the sample file, but I'm not sure how to translate that into my much larger working file...

I've tweaked the sample file to have 20 column criteria which is the number I have in my actual file.

Is it still doable?

In G32, enter with Ctrl+Shift+Enter, copied across right and down :

=SUM(VLOOKUP($F32,$A$3:$U$8,IF(1,MATCH(G$12:INDEX(G$12:G$31,MATCH("zzz",G$12:G$31)),$B$2:$U$2,0)+1),0))

Regards
Bosco
 

Attachments

  • sample(Vlookup 2).xlsx
    12.9 KB · Views: 6
Yay! I'm so happy - at first I had some issues because my dataset has several columns to the right of the names before the charge columns, but once I figured out to change the "+1" to the correct number all is good.

Thanks Bosco!
 
Back
Top