Array formula returns just one number everywhere

Mandark

New Member
Joined
Mar 18, 2014
Messages
43
I must be doing something wrong...but I came through all the manuals on the web and I am doing it exactly the same how it should work.

I have a table. And for each person (name) and each level, I want to get the maximum value from the column "number".

So if I select the whole range in column "formula", enter this:

Code:
{=MAX(IF(((A2:A18=A2)*(B2:B18=B2))>0,C2:C18))}

it should work, right?
Well, wrong. In every row, it returns the same value 7. Which is the maximum for name "a" and level "3". The reference on the name and level doesn't move.
Instead it should return 7 for the first three rows, then 3 for the next three rows, etc...

[TABLE="width: 500"]
<tbody>[TR]
[TD]name[/TD]
[TD]level[/TD]
[TD]number[/TD]
[TD]formula[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]3[/TD]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]3[/TD]
[TD]6[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]3[/TD]
[TD]7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]4[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]7[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]7[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]7[/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]2[/TD]
[TD]10[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]2[/TD]
[TD]11[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Can you please tell me, what am I doing wrong?

Thanks.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
The formula is fine apart from absolution of the ranges:

=MAX(IF((($A$2:$A$18=A2)*($B$2:$B$18=B2)),$C$2:$C$18))
 
Upvote 0
The formula is fine apart from absolution of the ranges:

=MAX(IF((($A$2:$A$18=A2)*($B$2:$B$18=B2)),$C$2:$C$18))

Unfortunately, your formula doesn't work either.
Returns 7 everywhere. Just try it in a sheet.
I am baffled. I don't know, what is wrong there.
 
Upvote 0
The formula steve the fish gave does work with the data you posted. The formula is a single-cell array formula. Do not select the entire C2:C18 range when pressing Ctrl+Shift+Enter. You only want one cell selected, press C+S+E, then copy the formula to the other cells.
 
Upvote 0
The formula steve the fish gave does work with the data you posted. The formula is a single-cell array formula. Do not select the entire C2:C18 range when pressing Ctrl+Shift+Enter. You only want one cell selected, press C+S+E, then copy the formula to the other cells.

Ah, so that was the problem. Thank you very much guys.

I still don't really understand what difference does this slight change make. Could any of you elaborate on it a bit in two sentences?
 
Upvote 0
Some functions, such as MAX, MIN, SUM, and AVERAGE, are designed to return a single value from an array of cells. Other functions, such as TREND, LINEST, and TRANSPOSE, return an array and must be entered as array formulas. If the outer function is designed to return a single value, it's a single-cell array formula.

I'm not sure how to explain the difference clearly. I often use Formulas >> Evaluate Formula on the ribbon when an array function doesn't work as I expect. Try Evaluate Formula on =SUM(ROW(A1:A5)) as a normal formula and then as an array formula. You need to turn the ROW function into an array for the formula to return what you expect. ROW(A1:A5) not entered with C+S+E returns a single value. With C+S+E it returns five values.

Then try Evaluate Formula on =AVERAGE(IF(ROW(A1:A5) > 2, ROW(A1:A5), FALSE)) – when there are arrays within an IF, it must be entered with C+S+E.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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