Count return of MAX

Sparky

Board Regular
Joined
Feb 18, 2002
Messages
210
Office Version
  1. 2010
Platform
  1. Windows
If the MAX function returns an answer of say 20 but in the range it is refering to there are actually four instances of 20 what do I use to show the answer of 4


Thanks in advance
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Paddy

My range of cells is I7:I26,I29:I52,U3:U26,U29:U52
I used your suggest formula and get the VALUE error

Thanks for the speedy reply
 
Upvote 0
You cant test multiple arrays against a single array. You would have to do an "or" statement.
 
Upvote 0
You'll have to excuse my ignorance I'm not familiar with the OR function.

Thanks again
 
Upvote 0
Considering your arrays are of different length, I would try the following:

=SUM(IF(A3:A8=MAX(A3:A8, A6:A12),1,0))+SUM(IF(A12:A16=MAX(A3:A8,A12:A16),1,0))

Enter as an array and substitute your ranges in for the ranges I used. There is probably a much simpler way to do this, but I can't think straight right now ;p
 
Upvote 0
Hi Sparky:

Use...
=COUNTIF(I7:I26,"="&MAX(I7:I26))+COUNTIF(I29:I52,"="&MAX(I29:I52))+COUNTIF(U3:U26,"="&MAX(U3:U26))+COUNTIF(U29:U52,"="&MAX(U29:U52))

Regards!
Yogi Anand
 
Upvote 0
That won't account for the max in for EVERY range? It will only account for the max in the range you are checking?
 
Upvote 0
Given that the required max seems to be the max of several distinct ranges of cells (I7:I26,I29:I52,U3:U26,U29:U52
), how about the following, which is effectively equivalent to the other alternatives but is a little shorter to type:

1) select the distinct ranges all at once (by holding down the control key when you're doing it)
2) give the resulting selection a name in the name box to the left of the formula bar, e.g. maxrange
3) in a spare cell (e.g. C1), enter:

=max(maxrange)

4) calculate the desired count using a countif:

=COUNTIF(I7:I26,"="&C1)+COUNTIF(I29:I52,"="&C1)+COUNTIF(U3:U26,"="&C1)+COUNTIF(U29:U52,"="&C1)

paddy
 
Upvote 0
On 2002-10-29 06:11, PaddyD wrote:
Given that the required max seems to be the max of several distinct ranges of cells (I7:I26,I29:I52,U3:U26,U29:U52
), how about the following, which is effectively equivalent to the other alternatives but is a little shorter to type:

1) select the distinct ranges all at once (by holding down the control key when you're doing it)
2) give the resulting selection a name in the name box to the left of the formula bar, e.g. maxrange
3) in a spare cell (e.g. C1), enter:

=max(maxrange)

4) calculate the desired count using a countif:

=COUNTIF(I7:I26,"="&C1)+COUNTIF(I29:I52,"="&C1)+COUNTIF(U3:U26,"="&C1)+COUNTIF(U29:U52,"="&C1)

Paddy, et al.,

Lets get fancy, though realistic...

With the morefunc.xll add-in installed, we can have...

In A1...

="{"&MCONCAT(I7:I126,",")&MCONCAT(I129:I152,",")&MCONCAT(U23:U26,",")&MCONCAT(U29:U52,",")&"0}"

In A2...

=EVAL("MAX"&"("&A1&")")

In A3...

=EVAL(SUMPRODUCT((EVAL(A1)=A2)+0))

In A4, instead of A2 and A3...

=EVAL(SUMPRODUCT((EVAL(A1)=EVAL("MAX"&"("&A1&")"))+0))

Aladin
This message was edited by Aladin Akyurek on 2002-10-29 07:23
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

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