View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default can I use =if with vlookup statements

I didn't try it, but it looks ok to me except that it would appear to do the
opposite of what you stated. if S222 = 13 then it will use
VLOOKUP(V222,'RES TYPE'!E$2:$F$220,6,FALSE)
The other thing is they are using different columns for the offsets (6 and
2), but that may be what you intended. Other than that, how is it not
working? Ah, the 6 would be a problem because you are only looking in
columns e:f. Either expand your lookup range or change the 6 to 2.
--
Kevin Vaughn


"suzyque" wrote:

I would like to use an if statement to fill in data in one column - I have 1
lookup table with 6 columns and a spreadsheet with multiple columns -
basically I want to ask if a cell=13 go to my look up table"res type"
A$2:$B$220 if not go to the same lookup table but go to E$2:$F$220
this is what I wrote but it is not working:
=IF(S222=13,VLOOKUP(V222,'RES TYPE'!E$2:$F$220,6,FALSE),VLOOKUP(S222,'RES
TYPE'!A$2:$B$220,2,FALSE))
I could really use some help - thanks