COUNTIF, COUNTIFS or SUMIFS

SpoctorDock

New Member
Joined
May 17, 2011
Messages
4
Hi there,

I'm trying to sum the values of one column based on conditions in another column, for example:

A------B
No.----Cash
3------£1.10
4------£1.80
23-----£30.10
No.----Cash
0------£0.00


Where A is the number of copies and B is the payment method (cash or invoice).

There are blank cells in both the Cash and Invoice since it's one or the other and never both, so I'm trying to filter out any instances of "Cash", blank cells or those with £0.00 values.

So far I've managed to do
Code:
=COUNTIFS(F6:F95,"<>0",F6:F95,"<>Cash",F6:F95,"<>"&"")
and
Code:
=COUNTIF(F6:F95, "<>Cash")-COUNTIF(F6:F95,"")
as an alternative, both of which count the correct number of copies, but when I attempt using things like SUMIF etc to count the total copies sold based on the code above, I always get 0.

Does anyone have any other ways of getting the right total?

Cheers
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hello SpoctorDock, welcome to MrExcel

You should be able to modify the first formula to a SUMIFS, i.e. if sum range is in column E try

=SUMIFS(E6:E95,F6:F95,"<>0",F6:F95,"<>Cash",F6:F95,"<>")
 
Upvote 0
Hi Harry,

Many thanks for your suggestion. It worked a treat!

I never knew there was a SUMIFS function. It's finally solved a week long dilemma :)
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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