How do you get excel to count only if two logical statements are fulfilled, using ranges ?

led84

New Member
Joined
Jul 24, 2013
Messages
6
Dear All,

This is my first mr. excel forum post so please go easy on me! I've done a search and can't find the answer to this question elsewhere on the forum

I am trying to get excel to count a value if (and only if) two logical conditions are fulfilled on two different cell ranges.

1st condition: In cell range x, the value should = C2

2nd condition: In cell range y, the value should be greater than 0

I've tried an AND statement and failed, and I've also tried COUNTIF statemetns and had no more luck. This could well be due to my skill level however.

Any advice would be much appreciated!

Thanks.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Thank you Redwolfx - the only problem I'm having is that that formula seems to sum the totatls of the two count if statements (it's returning a value that's too high) I'm looking the cell to only be counted if both of the statements are true.

e.g. if the value of the cell in range X does = C2 AND the value of the cell on the same row in Range Y is >0 then count it as one value. Does that make sense?
 
Upvote 0
Thank you Redwolfx - the only problem I'm having is that that formula seems to sum the totatls of the two count if statements (it's returning a value that's too high) I'm looking the cell to only be counted if both of the statements are true.

e.g. if the value of the cell in range X does = C2 AND the value of the cell on the same row in Range Y is >0 then count it as one value. Does that make sense?

Excel 2003
=SUMPRODUCT(--(rangex=C2),--(rangey>0))
For Excel >03 use COUNTIFS
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,108
Members
452,302
Latest member
TaMere

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