Count formula

mjmoon

Board Regular
Joined
Mar 1, 2005
Messages
249
I want to use the countif function to count data in A1..A50 if = "Boats" and if the data in column C1..C50 = "SeaRay". I know how to use the countif function for one condition but I have no idead how to use for two conditon as I have explained above. The end result should tell me how many SeaRay Boats I have on inventory along with all the other types I have.

Thank you in advance!
Marc
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi Marc

Use Sumproduct:

=SUMPRODUCT((A1:A50="Boats")+0,(C1:C50="SeaRay")+0)

you can replace the criteria (ie "Boats", "searay") with cell references holding these values.
 
Upvote 0
Thank you. What does the plus 0 mean and the end of each formula?

I also need a formula to sum the data in D1..D50 if A1..A50 = Boats and if C1..C50 = Sea Ray. Any suggestions?

Marc
 
Upvote 0
=SUMPRODUCT((A1:A50="Boats")+0,(C1:C50="SeaRay")+0,D1:D50)

The +0 coerces the generated list of True/Falses to 1s/0s so that they can be used in mathematical operations. You may also see *1 and -- used instead of +0. Another alternative is to carry out the coercion implicitly by multiplying all the terms together:

=SUMPRODUCT((A1:A50="Boats")*(C1:C50="SeaRay")*D1:D50)
 
Upvote 0

Forum statistics

Threads
1,222,122
Messages
6,164,082
Members
451,871
Latest member
sanalytics

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