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
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Sparky

Board Regular
Joined
Feb 18, 2002
Messages
210
Office Version
  1. 2010
Platform
  1. Windows
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
 

zacemmel

Well-known Member
Joined
Apr 29, 2002
Messages
636
You cant test multiple arrays against a single array. You would have to do an "or" statement.
 

Sparky

Board Regular
Joined
Feb 18, 2002
Messages
210
Office Version
  1. 2010
Platform
  1. Windows

ADVERTISEMENT

You'll have to excuse my ignorance I'm not familiar with the OR function.

Thanks again
 

zacemmel

Well-known Member
Joined
Apr 29, 2002
Messages
636
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
 

Yogi Anand

MrExcel MVP
Joined
Mar 12, 2002
Messages
11,454

ADVERTISEMENT

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
 

zacemmel

Well-known Member
Joined
Apr 29, 2002
Messages
636
That won't account for the max in for EVERY range? It will only account for the max in the range you are checking?
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
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
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,322
Messages
5,600,951
Members
414,417
Latest member
Nobu

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
Top