Reputation: 23
I need to find the max value in a column based on the header name. For example, I have a table that is ever changing because it is based on a query. On a cell in a separate worksheet, I need the value to be the max value of a particular column.
Right now I have a Column in the table named J0152. I need to find the max value in this column.
I have tried using the match function to get the column number but I don't know how to convert a column number into a range (column 2 into B:B).
Any suggestions would be greatly appreciated.
Upvotes: 2
Views: 1838
Reputation: 5185
You can use INDEX
/MATCH
for this.
Working example below. I don't know what your actual data is obviously but I created this basic example. The formula in cell H4
looks up the max value in the column name which is in cell G4
.
= MAX(INDEX($A$2:$E$6,0,MATCH(G4,$A$1:$E$1,0)))
If necessary, you can replace the limited column references with full column references, e.g. replace $A$2:$E$6
with $A:$E
.
Upvotes: 3