if, if(and), sumif or sumproduct

pippip

New Member
Joined
Nov 1, 2008
Messages
14
I'm trying to do a formula that does the following:

if A:A = "temp" and B:B = "a" then return 0, but if A:A = "temp" and B:B <> "a" then add C:C (but only those cells in C:C where A:A = "temp" and B:B <> "a").

So, in column A I have various categories (including "temp") and in column B those categories will either have an "a" against them or will be blank. In column C are the figures. In another cell I want to put the formula that will either return 0 (because every "temp" is matched by an "a") or will return the sum of those figures where "temp" is not matched by an "a").

I hope that all makes sense. I've searched around and tried different ways of doing this, but without luck. The stumbling block seems to be adding column C:C only where the two conditions are met.

Thanks in advance for your help.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I thought it was strange it didn't accept the 'not equal to' syntax and preferred the 'less than' syntax. I'm happy with dumb luck when it works.

And now I have two solutions and my understanding of excel continues to grow.
Dumb luck is better than the type of luck I have (no luck). :biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,849
Members
452,948
Latest member
UsmanAli786

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