Google Sheets – Formula to Show Heading

google sheetsworksheet-function

I have a Google Spreadsheet in which I am comparing projectors. Basically it has formulas to divide the bulb life/cost and contrast ratio/cost. Then it adds the total of the two and gives me a number. Using the max function I can determine which is the largest number in the set, but I would like to know if there is any formula to select the column header at the top based on the number.

If the highest number is under an Epson 2000. I want a formula to make it say Epson 2000.

Best Answer

You can do this with a combination of the INDIRECT and MATCH functions.

In the last column of your table add the following formula in line with the data that you would like to determine the max of:

Google Spreadsheet

=INDIRECT(ADDRESS([Name_Row], MATCH(MAX([Data_Span]), [Data_Span], 0) + [Column_Offset]))

Excel

=INDIRECT(ADDRESS([Name_Row], MATCH(MAX([Data_Span]), [Data_Span]) + [Column_Offset]))

Where [Name_Row] is the index of the row where your projector names are (e.g. 1 if the projector names are in row 1), [Data_Span] is the span of values that you're trying to find the max of, and [Column_Offset] is the distance of your first data value from column A (e.g. 1 if your data starts in column B).

See picture here.