View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default can't get lookup to work when i need it to report from a cell ref

Hi
Rather than lots of IF's you would be better off with a lookup table
If your lookup table was on sheet 2 in columns A and B
A F28
B F37
C F46
etc.
Then
=IF(C98="","",INDIRECT(VLOOKUP(C98,Sheet2!A:B,2,0) ))

Alternatively, without a lookup table
=IF(C98="","",INDIRECT("F"&28+(CODE(C98)-65)*9))

--
Regards
Roger Govier

"welshmatt" wrote in message
...
Hi
I am trying to convert the following nested if statement to allow me to be
able to choose from more than 8 variables.

=IF(C98="A",$F$28,IF(C98="B",$F$37,IF(C98="C",$F$4 6,IF(C98="D",$F$55,IF(C98="E",$F$64,IF(C98="F",$F$ 73,IF(C98="G",$F$82,IF(C98="H",$F$91,""))))))))

this equation does work but i need to be able to also say if cell C98="I"
but due to limitations of 7 nested ifs only i can't do this. I have tried
using lookup but it doesn't allow me to create an array with the
individual
cell references.

Note
C98 is blank until i enter a letter A through H.
all the references have calculations eg F37=IF(ISBLANK(B64),"",(D64/E64))

Any help would be very much appreciated
Matt