SOLVED

Sum If Different Cell Matches Criteria

Copper Contributor

In the example shown here, I have 3 changes assigned to various Cost Codes.  I need to find the total for each cost code at the bottom, but the codes won't always be in the same order, could appear multiple times, or not at all.

 

So, for example, in the first section, I need Excel to see "ELE-Electrical" in B6 and add what's in B4, but I also need it to see what's in B12 and see it's "CAB-Cabinetry" and ignore B10.  Then also include B16 because "ELE-Electrical" is in B18.

 

I was thinking I may need to rearrange the data elsewhere on the sheet and do any calculations somewhere else, but before I go down that route I wanted to see what other options are out there.  There are 25+ different cost codes and I'm evaluating 144 different changes so doing it manually is a daunting task.

 

JohnG768_2-1701294776123.png

 

 

 

2 Replies
best response confirmed by JohnG768 (Copper Contributor)
Solution

@JohnG768 

=SUMIF($B$4:$B$19,A22,$B$2:$B$17)

 

You can apply this formula.

sum cost codes.png

Thank you.  At first, I couldn't understand why that worked, but I believe I figured it out.  I appreciate the help.

1 best response

Accepted Solutions
best response confirmed by JohnG768 (Copper Contributor)
Solution

@JohnG768 

=SUMIF($B$4:$B$19,A22,$B$2:$B$17)

 

You can apply this formula.

sum cost codes.png

View solution in original post