Combine two Vlookup formulas

skpma

New Member
Joined
Mar 3, 2020
Messages
31
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Hello everyone

I have the following two formulas which work fine, but I want to combine them into one formula.

VBA Code:
=IF(ISERROR(VLOOKUP(G5,'SHEET2'!$C$2:$C$1001,1,FALSE)),FALSE,TRUE)
=IF(ISERROR(VLOOKUP(C5,'SHEET2'!$S$2:$S$1001,1,FALSE)),FALSE,TRUE)

My goal is to place a formula into H5 of sheet1, which first looks for the value G5 (sheet1) in sheet2 (column C) and if found checks if the value in C5 (sheet1) is the same as the value in column S (sheet2).
If yes then it should return TRUE, if no then FALSE.
Either the G5 or the C5 value can occur several times in sheet2, but the combination of the two is unique.
Is there a way to achieve that without VBA?

Thanks in advance for any help.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You mean you want both of them to be true to return TRUE? If that is so then:

Say you put 1st formula in A1 and 2nd formula in A2, then in H5 the formula would be:
=(A1*A2)=1
 
Upvote 0
Maybe...

=COUNTIFS(Sheet2!$C$2:$C$1001,G5,Sheet2!$S$2:$S$1001,C5)>0

M.
 
Upvote 0
Solution
Hi,

Without an uploaded sheet to test, I'm winging this:

Excel Formula:
=IF(ISERROR(VLOOKUP(" "&G5&" "&C5&" "," "&C2:C1001&" "&S2:S1001&" ",1,0)),FALSE,TRUE)

PS: may need CSE, I'm not sure.
 
Upvote 0
Hey guys,

thank you all for your answers.
Marcelo Branco's version did exactly what I needed.
 
Upvote 0
Hey guys,

thank you all for your answers.
Marcelo Branco's version did exactly what I needed.
Good to hear that you get what you're looking for
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,144
Members
448,552
Latest member
WORKINGWITHNOLEADER

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