View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default using vlookup within an if statement

Your logic seems sound, but maybe test for a number

=IF(VLOOKUP(A2,RPT7571!B:I,4,FALSE)=2,VLOOKUP(A2,R PT7571!B:I,5,FALSE),"")

Will A2 always be found, if not you may want to test it

=IF(ISNA(VLOOKUP(A2,RPT7571!B:I,4,FALSE)),IF(VLOOK UP(A2,RPT7571!B:I,4,FALSE)=2,VLOOKUP(A2,RPT7571!B: I,5,FALSE),""))



--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
"Sweetetc" wrote in message
...
I am trying to accomplish a vlookup within the IF statement but it won't
work


=IF(VLOOKUP(A2,RPT7571!B:I,4,FALSE)="2",VLOOKUP(A2 ,RPT7571!B:I,5,FALSE),"")

I have 2 spreadsheets with info. I am trying to say in a cell in
spreadsheet 1 - look into speadheet RPT7571 and if A2 matches A2 in my
spreadsheet 1 then look over 4 columns and if the 4th column has a value
of 2
then return the value in column 5 of the RPT7571 spreadsheet into my
spreadsheet 1 otherqise return nothing.

It does not work
Help

--
Thanks
ETC