Count Same Number in three ranges

RJB

Board Regular
Joined
Jul 22, 2002
Messages
149
Need a formula that will count the number of occurrences of that same number in three different ranges. The number that is to be compared to is in a cell that is a result of a formula. Example:
Lowest number found in three ranges: 30 (Answer is in A1)
Question: how many times does that number appear in the three ranges?
Syntax:
=Countif(Range1,range2,range3=A1)
Has to equal the cell reference value (A1), not a plain number (like 30)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
anything wrong with 3 countif's, or an equivalent ?!? Excel's not usually too happy performing calculations on non-contiguous ranges, so if the ranges are non-contiguous, having a single range name for the 3 ranges wont solve the problem...

paddy
 
Upvote 0
Yes they are contigious. Would the three countifs yield three different answers, like below?
Range1=1 Range2=0 Range3=2
This would solve the problem somewhat, but was hoping to save the space, reduce the possibility of error by getting just get one answer.
 
Upvote 0
On 2002-11-19 17:41, RJB wrote:
Yes they are contigious. Would the three countifs yield three different answers, like below?
Range1=1 Range2=0 Range3=2
This would solve the problem somewhat, but was hoping to save the space, reduce the possibility of error by getting just get one answer.

What are the exact ranges?
 
Upvote 0
if the ranges are contiguous, you could simply add a new name that covered all three ranges...
 
Upvote 0
Answered the contiguous question wrong. They are NOT contiguous. The formula (if it worked would look something like this)

=Countif(F7:24,F29:F42,F53:F65,"=S2")

S2 is the cell reference from which to compare. That number is derived from a MIN formula over the same ranges.
 
Upvote 0
On 2002-11-19 18:22, RJB wrote:
Answered the contiguous question wrong. They are NOT contiguous. The formula (if it worked would look something like this)

=Countif(F7:24,F29:F42,F53:F65,"=S2")

S2 is the cell reference from which to compare. That number is derived from a MIN formula over the same ranges.

You can get away with...

=COUNTIF(F7:F24,S2)+COUNTIF(F29:F42,S2)+COUNTIF(F53:F65,S2)
 
Upvote 0
=Countif(F7:24,F29:F42,F53:F65,"=S2")

I prefer using sumproduct to sumif / countif ('cos I'm happy with possibly having to sacrifice a little performance for not having to mess about with the quotation marks!)

=sumproduct((F7:F24=s2)+0)+sumproduct((F29:F42=s2)+0)+sumproduct((F53:F65=s2)+0)
 
Upvote 0
You win the prize

That worked on existing scenario...I will try it on various scenarios over the next week or so just to make sure.

Thanks very much
 
Upvote 0
PaddyD

Now that you are hot, can you do the same thing with the RANK function. Rank results over non-contiguous columns/cells?

References are the same as the SUMPRODUCT formula
=RANK(F7,F7:F24,F32:F45 etc.etc)
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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