# Count formula

#### mjmoon

##### Board Regular
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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

#### Richard Schollar

##### MrExcel MVP
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.

#### mjmoon

##### Board Regular
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

#### Richard Schollar

##### MrExcel MVP
=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)

Replies
1
Views
97
Replies
7
Views
124
Replies
1
Views
65
Replies
4
Views
87
Replies
2
Views
81

1,181,055
Messages
5,927,863
Members
436,573
Latest member
CMR237

### 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?

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