Sum cells in different rows/columns based on multiple criteria.

mboas

New Member
Joined
Dec 28, 2016
Messages
14
Hello mrexcel people!

I have a problem i would love your assistance with.

I have a dataset in range A3:BM448.

This dataset has in range A3:A448 multiple blanks and a few string variables (salary, expense, vacation and others), and in the range A3:BM3 a string of names.

Ideally what i would like to do is use a sum function to sum up values if they match both the string requirement in A3:A448 and the name requirement in A3:BM3. It would add up multiple numbers across various columns and cells.

An example is shown below:
NameN1N2N3N4N5N6N7N8N9
Salary3232323123
Salary4241
Expense424453
Vacation4241
Vacation
Salary424445534
Salary424

<tbody>
</tbody>

How would i sum up the values corresponding to the string "salary", and the name variable "N1, N2 and N4"?

Any help would be greatly appreciated.

Regards

Mboas
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Welcome to the forum.

Maybe:

ABCDEFGHIJ
1
2NameN1N2N3N4N5N6N7N8N9
3Salary3232323123
4Salary4241
5
6Expense424453
7Vacation4241
8Vacation
9Salary424445534
10
11Salary424
12
13TypeName(s)Sum
14SalaryN11194
15N2
16N4

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet5

Worksheet Formulas
CellFormula
D14=SUMPRODUCT((B3:J11)*(A3:A11=B14)*(ISNUMBER(MATCH(B2:J2,C14:C18,0))))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Change the ranges to match your actual sheet. Let us know if this works for you.
 
Upvote 0
Eric that is amazing!

Works perfectly, so simple, your help is much appreciated!

Happy holidays friend.

best regards

Mboas
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top