# How do I count if condition in Range A and if condition in B

#### Bob Katin

##### New Member
I have an Excel Spreadsheet and in which I have listed if people are attending the pot luck in cell C3 through C66 (yes, no, maybe). I have listed in cell D3 through D66 what they were asked to bring (main dish, side dish, dessert, beverage). I have counted the number of attendees in cell C67 by =COUNTIF(C1:C66,"yes"). I wanted to write a similar count if they have RSVP'd to come =COUNTIF(C1:C66,"yes") AND if they are bringing beverage in cell D1 through D66, than put the number in cell C68. Like wise put the number of desserts in cell C69 for those that are "yes", side dishes in cell C70, and main dishes in cell C71.

Is there a way to do this with Excel?

Thanks,
Bob

### Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
in C68

SumProduct(--(C1:C66 ="yes"),--(D1:D66 ="beverage"))

in C69

SumProduct(--(C1:C66 ="yes"),--(D1:D66 ="dessert"))

the ranges for each side of the equation need to be the same size, so these formulas as written should work. Adjust the text in the 2nd half as needed.

The result will be a value matching the total meeting both criteria

Replies
3
Views
1K
Replies
3
Views
221
Replies
1
Views
690
Replies
3
Views
306
Replies
3
Views
252

1,203,244
Messages
6,054,363
Members
444,718
Latest member
r0nster

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

### Which adblocker are you using?

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

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