Using If statements within Vlookup

September 14, 2011 at 11:29:44
Specs: Windows XP
I have an excel table where I want to use Vlookup to find an account number and return information in a certain column related to that account. However, I want to use an IF command within the Vlookup. For example, lookup accoutn number in column 1, IF the value in the 7th column is "S" then return the value in the sixth column, otherwise leave it blank. How can I combine If and Vlookup to do this?

Many thanks for your help.

Ally B

See More: Using If statements within Vlookup

Report •

September 14, 2011 at 11:56:44
The arguments in an =IF() statement are:

=IF(Logical test , Value If TRUE , Value If FALSE)

So something like:


Is that what your looking for?


Report •

September 14, 2011 at 12:38:14
I re-read your post and I think what your looking for is something
more along the lines of:

=IF( 1stVLOOKUP="S" , 2ndVlookupget# , DoNothing )


Report •

September 14, 2011 at 13:14:19
Something like this should work, assuming the Account Number will always exist in Column 1. If there is a possibility that it won't, then you are going to have to modify the formula for the #N/A error that will occur.

=IF(VLOOKUP(A1, $B$1:$H$7, 7, 0) = "S", VLOOKUP(A1, $B$1:$H$7, 6, 0), "")

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

Related Solutions

Ask Question