# Find Column Header Name for the Max in a Row

• Hello,

I have a spreadsheet with row one consisting of months. From Row2 downward, the first column of each row gives a product name and each of the other columns/cells in that respective row shows sales in that respective month.

I am trying to find the max # in each row (per product) and retrieve the month at the top to see which month had the most sales. I will put this into a mini separate chart so I can see which month per product had the most sales.

I know how to find the max per row, but I don't know how to retrieve the topmost cell in the column of the max#. Even more confused on how to do this for multiple rows.

Help is very appreciated. Thank you.

• Re: Find Column Header Name for the Max in a Row

Try the 'Possible Answers' section below - the 2nd looks to be exactly what you need.

• Re: Find Column Header Name for the Max in a Row

While that's what I'm looking for, and it works perfectly for the row directly under my column headers, it returns N/A when I try to apply to any other row because there is a gap in rows. For example, I would like to find which column header located in B1:X1 is the max of B3:X3 or B4:X4 and so on.

How can this equation be changed to take into account gapped rows?

• Re: Find Column Header Name for the Max in a Row

Quote from Robert Mika;679226

Unfortunately it doesn't choose the max of the row for some reason. It will return the header for a column that either isn't the max or doesn't have data in it.

• Re: Find Column Header Name for the Max in a Row

Coudl you post your workbook with example?

• Re: Find Column Header Name for the Max in a Row

Here is my attempt at it as per workbook attached using this formula

=INDEX(\$A\$1:\$F\$9,1,MATCH(MAX(A2:F2),A2:F2,0))

## Files

• Re: Find Column Header Name for the Max in a Row

Yes!! Thank you very much! It works.

Thanks everyone!

• Re: Find Column Header Name for the Max in a Row

Post deleted

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!