Finding MAX value based on combination of two criteria

JonHaywood

New Member
Joined
Jul 23, 2014
Messages
34
Hi,
I want to show a maximum value of an array (of dates) based on a combination of two criteria (a kind of 'MAXIFS' function).
My data is a bit like this ...
ABC
1DateCriteria 1 met?Criteria 2 met?
201/03/2015yy
315/06/2015ny
421/06/2015yy
508/01/2016ny
612/02/2016yn

<tbody>
</tbody>

I'm trying to create a formula to show the last date that both criteria were both "y" (should be "21/06/2015" from the data above).

I can use this formula (entered as an array formula) to show the last date based on one matching criteria...
Code:
=MAX(IF(C2:C6="y",A2:A6,0))
(returns "08/01/2016")

...but when I use 'AND' to choose both criteria I only get the 'value if false' returned...
Code:
=MAX(IF(AND(B2:B6="y",C2:C6="y"),A2:A6,0))
(again, entered as an array formula, returns 0)

Is the AND function not compatible with array formulae? Am I missing something basic?

If I'm barking up the wrong tree, is there another way to do this?

Many thanks

Jon
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi,

you could try

Code:
=MAX(IF(B2:B6="y",IF(C2:C6="y",A2:A6,0)))



Code:
=MAX(IF(B2:B6&C2:C6="yy",A2:A6,0))


array entered

or

Code:
=MAX(INDEX((B2:B6="y")*(C2:C6="y")*A2:A6,))

just enter
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,024
Messages
6,122,729
Members
449,093
Latest member
Mnur

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