Get data from a header in Excel.

Copper Contributor

Hi everyone.

I wish you can help me.
I need to obtain the Maximum of the range Y5:AA5 and from the maximum, it returns the data of cell Y1, Z1 or AA1, as the case may be. That is to say:
If Y5 is the highest, in Result I want to get "A Auditivo"
If the Z5 is the highest, in Result I want to get "B Visual"
If AA5 is the highest, in Result I want to get "C Kinestésico"

Your contribution will help me a lot.

Thanks a lot.



3 Replies
best response confirmed by JesusOcio (Copper Contributor)


You can achieve this in Excel by using a combination of functions like MAX, MATCH, and INDEX to find the maximum value in the range Y5:AA5 and then return the corresponding header from the range Y1:AA1. Here is how you can do it step by step:

  1. In a cell where you want to display the result (let's say it's in cell D1), enter the following formula:

=INDEX(Y1:AA1, MATCH(MAX(Y5:AA5), Y5:AA5, 0))

Here is what this formula does:

  • MAX(Y5:AA5) finds the maximum value in the range Y5:AA5.
  • MATCH(MAX(Y5:AA5), Y5:AA5, 0) finds the position (column number) of the maximum value within the range Y5:AA5. The 0 as the last argument of MATCH ensures an exact match.
  • INDEX(Y1:AA1, ...) returns the corresponding header from the range Y1:AA1 based on the column number obtained from the MATCH function.

So, when you enter this formula in cell D1, it will display "A Auditivo" if Y5 is the highest, "B Visual" if Z5 is the highest, and "C Kinestésico" if AA5 is the highest.

Make sure to adjust the cell references (Y5:AA5, Y1:AA1, and cell D1) to match your actual worksheet layout.

Alternative formula: =CHOOSE(MATCH(MAX(Y5:AA5), Y5:AA5, 0), "A Auditivo", "B Visual", "C Kinestésico")

This formula achieves the same result as the previous one but in a more compact way.

The text and steps were edited with the help of AI.


My answers are voluntary and without guarantee!


Hope this will help you.

Was the answer useful? Mark them as helpful and like it!

This will help all forum participants.



Thank you so much! Both ways works wonderful, I really apreciate it.


PS: (I just had to change the name of the functions to spanish, hehehe)



I'm pleased that I was able to help you.
I also wish you much success with Excel!