Combining one IF formula with a Vlookup Formula

McNeil87

Board Regular
Joined
Dec 6, 2019
Messages
55
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Hello!

I'd like to try to combine/join these two formulas together to return TRUE or FALSE

First Formula: IF(F2="GB",TRUE,FALSE)
Second Formula: =IF(ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)),"FALSE","TRUE")

Essentially would like to say return True if the following condition is met: IF F2=GB and G2 is in the lookup list, then "True", otherwise if F2 <>GB and G2 is not in lookup list, then False.

Any suggestions is greatly appreciated!

Thank you!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE))
will give TRUE if G2 is not in the lookup list
F2 =GB will give TRUE

so combine then
AND ( ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)), F2 =GB )
should give a TRUE

BUT you dont need an IF

as
=AND ( ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)), F2 =GB )
will give a true or false result

hope thats what you want
 
Upvote 0
I think this will work:
Excel Formula:
=IF(ISERROR(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)),FALSE,TRUE)
Without an actual sample (posted using XL2BB), it's hard to say.
 
Upvote 0
Thanks! I receive an #NAME Error:

=AND(ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)),F2=GB)


ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE))
will give TRUE if G2 is not in the lookup list
F2 =GB will give TRUE

so combine then
AND ( ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)), F2 =GB )
should give a TRUE

BUT you dont need an IF

as
=AND ( ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)), F2 =GB )
will give a true or false result

hope thats what you want
 
Upvote 0
=AND(ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)),F2=GB)
I think you need double-quotes around "GB":
Excel Formula:
=AND(ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)),F2="GB")
 
Upvote 0
Thanks!

It's so close -- but i noticed it is returning TRUE for all of F2 that equals "GB."

I need it to return TRUE if F2="GB" AND Only return TRUE for F2 if G2 is a match against the lookup.

=AND(ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)),F2="GB")
 
Upvote 0
=AND(ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)),F2="GB")
change to
=AND(NOT(ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE))),F2="GB")


IF F2=GB and G2 is in the lookup list, then "True", otherwise if F2 <>GB and G2 is not in lookup list, then False.
 
Upvote 0
Solution
well, i misread the requirement .....

as i said
ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE))
will give TRUE if G2 is not in the lookup list

but you wanted
TRUE if G2 is in the lookup list,

so i just used a NOT() which reverses the Logic

so IF the result of ISNA(VLOOKUP(G2,UK!$M$2:$M$92,1,FALSE)) produces a TRUE - G2 is not in the lookup list , and you wanted that to be FALSE , then the NOT changes the TRUE to a FALSE
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top