Count or Sum - Assistance

Ecksel

New Member
Joined
Apr 18, 2011
Messages
2
Hello MrExcel,
Long time reader, first time poster.

Let me set this up:
I have 4 columns A thru D.

Column A = Yes or No
Column B = Apples, Oranges, Bananas, Pears, Grapes
Column C = Farmers Market, Grocery Store, Farm
Column D = (Age of fruit) in numbers

In a summary tab, I'm trying to put together a formula to count the follow (as an example):

How many are labeled YES in ColA and are Apples in ColB and are from either the Grocery Store or Farm and are over 15 days old.

I can't seem to get the formula(s) to work.

Anyone's assistance is greatly appreciated.

FYI - I can get the CountIf to work if I'm choosing ONE (1) criteria from ColC, but not multiple.

Thanks in advance
 

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.
Hi and welcome to the forum. :)

In Excel 2007 and later:
Code:
=SUM(COUNTIFS(A:A,"Yes",B:B,"Apples",C:C,{"Grocery Store","Farm"},D:D,">15"))

In Excel 2003 and earlier*:
Code:
=SUMPRODUCT(--(A2:A100="Yes"),--(B2:B100="Apples"),
                    --(C2:C100={"Grocery Store","Farm"}),--(D2:D100>15))

*note you cannot use entire column references such as A:A.
 
Upvote 0
Sorry, that was my mistake. Try this instead:

Code:
=SUMPRODUCT((A2:A100="Yes")*(B2:B100="Apples")*(C2:C100={"Grocery Store","Farm"})*(D2:D100>15))
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,736
Members
452,940
Latest member
Lawrenceiow

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