View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Stephen[_2_] Stephen[_2_] is offline
external usenet poster
 
Posts: 364
Default Trying to get a decimal point using Match command

"Stephen" <none wrote in message
...
"nynybmbc" wrote in message
...
I am doing a ranking (1,2,3,4) where 1 = 6 points, 2= 4.5 points, 3 = 3
points and a 4 = 1.5 points. Any suggestions on how I can capture the
4.5
and 1.5, I was using the Match function, where
=MATCH(G12,{4,"b",3,2,"e",1},0)


MATCH returns the relative position in an array, so by definition can only
return integers. You need a VLOOKUP.
Put your ranks (1,2,3,4) in (say) A1:A4 and the corresponding points
(6,4.5,3,1.5) in B1:B4. (You can choose some other convenient 4x2 area for
this - just alter the references).
Then use the formula
=VLOOKUP(G12,A1:B4,2,0)


Or, if your ranking list will always be so short and you want to keep it all
in the formula, use
=VLOOKUP(G12,{1,6;2,4.5;3,3;4,1.5},2,0)