VLOOKUP challenge

Jovinchious

New Member
Joined
Oct 12, 2022
Messages
19
Office Version
  1. 2007
Platform
  1. Windows
Hello everyone,

I need a bit of help.

I need some formula that will make me the following…

if the text in the A column of "sheet1" is the same as the text anywhere in the A column of "sheet2", and also if the text in the B column of "sheet1" is the same as the text anywhere in the B column of "sheet2",
then return the value from the D column of "sheet2"
So, both conditions must be satisfied, so that program can return the value from column D only if the names in column A and in column B match.
The one small challenge is that sometimes names in A and B column are the same, but number from D column is unique. In that case, program should give any number and not repeat the same number twice.

example:

Sheet1

A B D
Calculator Central ?
Calculator Central ?
Keyboard Informatics ?
Keyboard Informatics ?
Keyboard Central ?

Sheet2

A B D
Calculator Central 5865685
Calculator Central 9967967
Keyboard Informatics 2223423
Keyboard Informatics 5445345
Keyboard Central 6346333

I ve some of the following formulas but cant get it done...
=IF(COUNTIFS(Sheet2!A:A; A88; Sheet2!B:B; B88)>0; INDEX(Sheet2!D:D; MATCH(A88&B88; Sheet2!A:A&Sheet2!B:B; 0)); "")
=IF(SUMPRODUCT((Sheet2!A:A=A88)*(Sheet2!B:B=B88)*(Sheet2!D:D))>0; INDEX(Sheet2!D:D; MATCH(1; (Sheet2!A:A=A88)*(Sheet2!B:B=B88)*(Sheet2!D:D<>""); 0)); "")
=INDEX(Sheet2!$D:$D;MATCH(1;(Sheet1!$A:$A=Sheet2!$A:$A)*(Sheet1!$B:$B=Sheet2!$B:$B);0))

Thanks in advance!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hello,

If I understood your challenge correctly, this should work with the appropriate changes to match your data locations:

Excel Formula:
=IF(ISNA(MATCH(A7&B7,Sheet8!$A$1:$A$18&Sheet8!$B$1:$B$18,0)),"Not found",INDEX(Sheet8!$D$1:D24,MATCH(A7&B7,Sheet8!$A$1:$A$18&Sheet8!$B$1:$B$18,0)))

I used MATCH to find the row where both criteria were found.

Hope that helps,

Doug
 
Upvote 1
thank you! I found another way simplier way...just sticked together text from A and B column and did it with simple vlookup

=IF(COUNTIF(Sheet2!$A:$A; A17)>1; "DUPLICATE";VLOOKUP(A17; Sheet2!$A:$E; 5; FALSE))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,879
Messages
6,175,147
Members
452,615
Latest member
bogeys2birdies

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