only sum if column next to it is not...

basher450

New Member
Joined
Jan 26, 2005
Messages
23
Hi

I have someting like this:
NAMEAMOUNT
josh454.1
emma320.0
andy115.5
larry215.5
Willy285.8

<tbody>

</tbody>

but with hundreds of rows.
I want to sum the "amount" column only if the "name" column does not contain the words "josh" or "andy".
the result for example in this case should be:
320.0 ("emma") + 215.5 ("larry") + 285.8 ("Willy") = 821.3

I tried with SUMIF and INDEX but got totally lost.
please help ?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
=SUM(IF(A2:A6<>"josh", IF(A2:A6<>"andy", B2:B6,0),0))

required CTRL SHIFT ENTER

thanks, it works for me.
but this could get a little messy when I need more than two to ignore. (20 for example)
what could I do if I needed 20 elements to ignore ?
 
Upvote 0
=SUM(B2:B7)-SUMPRODUCT(SUMIF(A2:A7,H1:H3,B2:B7))

put the names you wish to ignore in column H, H1:H3 in the above represents the 3 names you wish to ignore
 
Upvote 0

Forum statistics

Threads
1,213,485
Messages
6,113,931
Members
448,533
Latest member
thietbibeboiwasaco

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