Forum Discussion
Returning a text value from an array
Hi Jerome,
In general not necessary to use IF and AND here. Each your condition returns array from TRUE and FALSE, other words array from 1 and 0. Multiplication of all your conditions give combined array for all conditions which filter the column you'd like to return.
First you formula (array one) could be re-written as
=INDEX(Database!$A:$AX,
MATCH(
MAX((Database!$AX:$AX=B146)*Database!$B:$B),
(Database!$AX:$AX=B146)*Database!$B:$B,
0),1)which returns the cell in the column A in the row there the date (column B) is maximum for all rows where the score (column AX) is equal to B146.
To above you may as many criteria as you need using multiplication. To filter additionally by column C we may use (also as array formula)
=INDEX(Database!$A:$AX,
MATCH(
MAX((Database!$AX:$AX=B146)*(DATABASE!$C:$C="L")*Database!$B:$B),
(Database!$AX:$AX=B146)*(DATABASE!$C:$C="L")*Database!$B:$B,
0),1)
And INDEX could be on $A:$A
The only difference with your variant if no combination is found your formula returns the error, and modified formula returns the cell in first row. Usually in first row are column names, could be not critical, otherwise another modification is required.
- DeletedJul 17, 2017
Thank you for the help. You got me on the right track. It didn't match exactly, but the final solution that worked was:
=INDEX(DATABASE!$A:$A,MATCH(1,(DATABASE!$B:$B=MAX(IF((DATABASE!$AW:$AW=B145)*(DATABASE!$C:$C="L"),(DATABASE!$B:$B))))*(DATABASE!$AW:$AW=B145)*(DATABASE!$C:$C="L"),0))
Thank you again!!
- SergeiBaklanJul 18, 2017Diamond Contributor
Hi Jerome,
Glad to know you sorted this out. Just in case, i compared both formulas (only changed in my AX on AW), they give the same result - see attached.