If - and - vlookup

jwang776

New Member
Joined
Feb 6, 2017
Messages
6
Hi Everyone,

I have a table where I'm trying to lookup a transaction ID for a particular sales member. I'm not sure how to approach this and my efforts around an IF( AND( VLOOKUP( formula have proved futile.

The following tables show what I'm trying to accomplish.


TABLE 1
[TABLE="width: 500"]
<tbody>[TR]
[TD]Associate (A)[/TD]
[TD]Transaction ID (B)[/TD]
[/TR]
[TR]
[TD]Jon Snow[/TD]
[TD]??? - Trying to find the transaction ID for a Dragon Sword sold by Jon Snow[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 500"]
<tbody>[TR]
[TD]Associate[/TD]
[TD]Transaction ID[/TD]
[TD]Item Class[/TD]
[TD]Item Type[/TD]
[/TR]
[TR]
[TD]Jon Snow[/TD]
[TD]45A[/TD]
[TD]White Walker[/TD]
[TD]Sword[/TD]
[/TR]
[TR]
[TD]Tyrion Lannister[/TD]
[TD]4234236A[/TD]
[TD]Giant[/TD]
[TD]Mace[/TD]
[/TR]
[TR]
[TD]Jon Snow[/TD]
[TD]46347A[/TD]
[TD]Dragon[/TD]
[TD]Sword[/TD]
[/TR]
[TR]
[TD]Tyrion Lannister[/TD]
[TD]4423428A[/TD]
[TD]Dragon[/TD]
[TD]Tooth[/TD]
[/TR]
[TR]
[TD]Jon Snow[/TD]
[TD]4121239A[/TD]
[TD]Giant[/TD]
[TD]Club[/TD]
[/TR]
[TR]
[TD]Jon Snow[/TD]
[TD]553450A[/TD]
[TD]Giant[/TD]
[TD]Boot[/TD]
[/TR]
[TR]
[TD]Sansa Stark[/TD]
[TD]341231232A[/TD]
[TD]White Walker[/TD]
[TD]Glove[/TD]
[/TR]
[TR]
[TD]Jon Snow[/TD]
[TD]534534534A[/TD]
[TD]Dragon[/TD]
[TD]Tooth[/TD]
[/TR]
[TR]
[TD]Sansa Stark[/TD]
[TD]123123A[/TD]
[TD]Wight[/TD]
[TD]Cloak[/TD]
[/TR]
[TR]
[TD]Sansa Stark[/TD]
[TD]234590789A[/TD]
[TD]Wight[/TD]
[TD]Sword[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I was thinking IF(AND(VLOOKUP(A2,TABLE2(A1:D11),4,false)="SWORD",VLOOKUP(A2,TABLE2(A1:D11),3,false)="DRAGON"),VLOOKUP(A2,TABLE2(A1:D11),2,false),"THIS FORMULA DID NOT WORK")

This was definitely not the correct logic and any help in understanding this type of query is extremely appreciated! Thank you to everyone for reviewing!

p.s. running excel 2013

Sincerely,

Jon
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Re: Seeking Expert Help If Available, Complex IF - AND - VLOOKUP

Code:
=INDEX(B1:B11,MATCH("Jon Snow"&"Dragon"&"Sword",A1:A11&C1:C11&D1:D11,))
array formula, run with Ctrl+shift+enter
 
Upvote 0
Re: Seeking Expert Help If Available, Complex IF - AND - VLOOKUP

Code:
=INDEX(B1:B11,MATCH("Jon Snow"&"Dragon"&"Sword",A1:A11&C1:C11&D1:D11,))
array formula, run with Ctrl+shift+enter

Hi Shaowu. This is exactly what I was looking for!! Many thanks and extremely appreciated. Do you recommend a good place for learning typical array formulas? Up until now, I had not explored this topic very much and am eager to learn! Anyhow, thank you for the amazing solution.

-Jon
 
Upvote 0
Re: Seeking Expert Help If Available, Complex IF - AND - VLOOKUP

Morning, I'm located in china, I learned knowledge about excel in an excel forum, but the language is chinese. Hope you can master array formula soon, you will see a wonderful and amazing world :)
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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