column number of the answer to MIN

D

DKY

How do I grab the column number to this function
MIN(C2:F2)

Actually, what I'm looking to do is display the header of whatever th
answer to the above function is. All the headers are in row 1. So i
essence, if the min is in column D then it will display the data in D1
 
D

DKY

I guess I should have mentioned that I would like to copy this down to
other rows, This only works on row 2 but not on row 3 etc....

One other quick question. How do I format this
MIN(C2:F2)
into Dollars, same format as when I hit the $ button.
 
D

DKY

I just noticed, it's because it changes it to this
=(INDEX(C2:F2,1,MATCH(MIN(C3:F3),C3:F3,0)))&" "&MIN(C3:F3)
instead of this
=(INDEX(C1:F1,1,MATCH(MIN(C3:F3),C3:F3,0)))&" "&MIN(C3:F3)

How do I keep that first C1:F1 the same if I'm copying it down
 
D

DKY

That works, thanks

One other question, how do I format this
MIN(C2:F2)
into Dollars, same format as when I hit the $ button
 
D

DKY

DKY said:
That works, thanks

One other question, how do I format this
MIN(C2:F2)
into Dollars, same format as when I hit the $ button.

Let me explain this a little more, I wanted to add
MIN(C2:F2)
to this
INDEX(C$1:F$1,1,MATCH(MIN(C2:F2),C2:F2,0))
so that it looks like this
MIN(C2:F2)&" "&(INDEX(C$1:F$1,1,MATCH(MIN(C2:F2),C2:F2,0)))
but I want to format this part
MIN(C2:F2)
into Dollars and not the rest of it. Is that possible
 
N

Niek Otten

=TEXT(MIN(C2:F2),"FormatString")&" "&(INDEX(C$1:F$1,1,MATCH(MIN(C2:F2),C2:F2,0)))

Replace FormatString with your format string. You can find it by formatting a cell as $ and then choose Format>Cells>Number tab,
Custom and copy the format string from the Type box.
It has to be in quotes in your formula.
 
Top