Hi,
I would like to know if it is possible to combine the VLOOKUP and MAX/MIN functions into one formula.
If you see the attached spreadsheet it will make more sense to what I am trying to accomplish. I want the maximum value from my data to be displayed and this is simple with a =MAX(B2:B11) formula and this would display the value 79.3 but this result on its own is meaningless! I need the name of the destination that corresponds to the numerical data to be displayed along with it. After some researching I understand that a VLOOKUP function can provide an output depending on what is inputted but I want the maximum value to be the numerical output with its corresponding text data.
How about this?
=INDEX(A:A,MATCH(MAX(B:B),B:B,0))
that will bring you first max result.
"Relax. What is mind? No matter. What is matter? Never mind!"
Thanks for that, it works!
But could you explain what the formula is actually doing so I have an understanding of using it or tweaking it for other uses?
That would be nice since it's very usefull and common:
INDEX(array,row_num,column_num)
So, in some array you enter row number and column number and get result from that cell.
INDEX(A1:B2, 2, 2) will return whatever is in B2 cell.
Now, let's go step further:
=INDEX(A:A,something,) will return actually row number calculated by something (no need of column number since it's one dimensional array A:A)
something is your issue.. in this case MAX
=MATCH(MAX(B:B),B:B,0)
MATCH(lookup_value, lookup_array, [match_type])
And lookup value is MAX in this case... Actually, this formula returns number in wich cell is maximum value in B column.
Of course, that's the value we use above in INDEX function.
so, let's summarise:
=INDEX(A:A,MATCH(MAX(B:B),B:B,0))
Formula find MAX value in B column.
Then MATCH returns where is that value in B column.
Then INDEX returns what's in same row of that value...
maybe would be nice to test formula evaluation at this time because I'm not good explainer![]()
"Relax. What is mind? No matter. What is matter? Never mind!"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks