Using IF and VLOOKUP?

SUMU15

New Member
Joined
Jul 27, 2017
Messages
2
So, I'm new to this forum and hoping you can help me with a formula... I think it's simple but explaining it might be hard.

I have two tabs:

tab 1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]URN[/TD]
[TD]Ref[/TD]
[/TR]
[TR]
[TD]2318[/TD]
[TD]YOU008[/TD]
[/TR]
[TR]
[TD]2319[/TD]
[TD]YOU009[/TD]
[/TR]
</tbody>[/TABLE]

tab 2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Ref[/TD]
[TD]sALES[/TD]
[/TR]
[TR]
[TD]YOU008[/TD]
[TD]£5[/TD]
[/TR]
[TR]
[TD]YOU008[/TD]
[TD]£10[/TD]
[/TR]
[TR]
[TD]YOU009[/TD]
[TD]£5[/TD]
[/TR]
[TR]
[TD]YOU009[/TD]
[TD]£25[/TD]
[/TR]
[TR]
[TD]YOU009[/TD]
[TD]£23[/TD]
[/TR]
[TR]
[TD]YOU009[/TD]
[TD]£15[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I want a formula that will assign the correct URN to the ref in tab 2 - for example YOU008 would be assigned URN 2318 and YOU009 would be assigned URN 2319

I think I need to do a VLOOKUP on tab 2 that will assign the URN value in tab 2. So a combination of an if command and a v-lookup.

Make sense to anyone out there?

Thank you!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
maybe something like...

Unknown[TABLE="class: grid, width: 300"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD]tab 1:[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]URN[/TD]
[TD]Ref[/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: right"]2318[/TD]
[TD]YOU008[/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: right"]2319[/TD]
[TD]YOU009[/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD]tab 2:[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD]Ref[/TD]
[TD]sALES[/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD]YOU008[/TD]
[TD]£5[/TD]
[TD="align: right"]2318[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD]YOU008[/TD]
[TD]£10[/TD]
[TD="align: right"]2318[/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD]YOU009[/TD]
[TD]£5[/TD]
[TD="align: right"]2319[/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD]YOU009[/TD]
[TD]£25[/TD]
[TD="align: right"]2319[/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD]YOU009[/TD]
[TD]£23[/TD]
[TD="align: right"]2319[/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD]YOU009[/TD]
[TD]£15[/TD]
[TD="align: right"]2319[/TD]
[/TR]
</tbody>[/TABLE]
tab 1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]C9[/TH]
[TD="align: left"]=INDEX('tab 1'!$A$3:$A$4,MATCH(A9,'tab 1'!$B$3:$B$4,0))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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