Max ifs with field not equal to list of values

mikey1987

Board Regular
Joined
Mar 22, 2013
Messages
65
Hello Excel gosu's,

I have a pickle with an excel formula, and I can't seem to find an answer anywhere.
My data looks vaguely like the data below

studentclassmarks
AA10
BA10
AB7
BB9
AC3
BC9
AD1
BD4

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>

Let's say I want the maximum 'marks' of student B but NOT for class A & B. (let's assume there are thousands of records)
I know I can fix this by hardcoding A, B in the MAXIFS function, but I want to read these values from a list or table.

excludeClass is a named range containing {"A";"B"}
In my head the function looks like this: {=MAXIFS(marks,student,"A",class,"<>"&excludeClass)}
That doesn't work (it says 7 instead of 4).

I then tried converting 'class' to a ones and zeroes like this
=MAXIFS(marks,student,"A",IF(ISERROR(MATCH(class,excludeClass,0)),1,0),1)
That function returns {0;0;0;0;0;0;1;1} which I wanted to filter on 1, but apparantly that doesn't work either
It gives me an embarassing #VALUE

Does anyone have a clue :confused:?

Cheers!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try this:

ABCDEFG
1studentclassmarksStudentExcludeMax Score
2AMath10AMath3
3BMath10English
4AEnglish7
5BEnglish9
6AHistory3
7BHistory9
8ASpanish1
9BSpanish4

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Array Formulas
CellFormula
G2{=MAX(IF(A2:A9=E2,IF(ISERROR(MATCH(B2:B9,F2:F5,0)),C2:C9)))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



I get an answer of 3. If you really mean 4, please explain how you get that value.
 
Upvote 0

Forum statistics

Threads
1,215,912
Messages
6,127,685
Members
449,398
Latest member
m_a_advisoryforall

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