# Combine two Vlookup formulas

#### skpma

##### New Member
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

#### Zot

##### Well-known Member
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

#### Marcelo Branco

##### MrExcel MVP
Maybe...

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

M.

#### jtakw

##### Well-known Member
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.

#### skpma

##### New Member

Hey guys,

Marcelo Branco's version did exactly what I needed.

#### Zot

##### Well-known Member
Hey guys,

Marcelo Branco's version did exactly what I needed.
Good to hear that you get what you're looking for

#### Marcelo Branco

##### MrExcel MVP
Marcelo Branco's version did exactly what I needed.

M.

Replies
1
Views
180
Replies
1
Views
100
Replies
6
Views
154
Replies
19
Views
285
Replies
2
Views
249

1,130,042
Messages
5,639,728
Members
417,108
Latest member
Thein Than

### 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.

### Which adblocker are you using?

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

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