Using an Indirect within a Minimum

428 Views Asked by At

I have a script

=MATCH(H2,INDIRECT("'SALES'!A"&R2&":CC"&R2),0) 

to produce the column number of the minimum value on the SALES sheet. The issue is that when I change the minimum value it produces a completely wrong number and reads the wrong column. How would I get this to read only specific columns and find the minimum: L, W, AH, AS

1

There are 1 best solutions below

0
On

Guessing that: L, W, AH and AS are column references in SALES containing values from which you wish to locate the minimum, and that these values are all in Row2 then:

=MATCH(MIN(L2:W2:AH2:AS2),2:2)  

should give you the column number. Add 64 and wrap in CHAR() for the column letter reference.