Multiple VLOOKUP Formulas

markzasz

New Member
Joined
Aug 12, 2015
Messages
29
I have a DB that contains over 50K records, and I need to look at the data in column G and write in column H what type of data, I have the following Formula that get almost all the data defined
=IFNA(VLOOKUP([@Column1],$J$3:$K$24,2,0),"PROD")
However I have a section of data that if it starts with T or U I need to designate as "NPROD" I have tried to following formula and it is not placing the name "NPROD". here is what I used
=IFERROR(VLOOKUP([@Column1],$J$3:$K$24,2,0),IFERROR(VLOOKUP($M$3&"*",$G16485,"NPROD"),"PROD"))
it only posts "PROD" when T is found. Can someone please help?

I can send input and tables if requested.

Mark
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
How about something like this?
Code:
[COLOR=#333333]=IF(OR(LEFT([/COLOR][COLOR=#333333][@Column1],1)="T",[/COLOR][COLOR=#333333]LEFT([/COLOR][COLOR=#333333][@Column1],1)="U"),[/COLOR][COLOR=#333333]IFNA(VLOOKUP([@Column1],$J$3:$K$24,2,0),"NPROD"),[/COLOR][COLOR=#333333]IFNA(VLOOKUP([@Column1],$J$3:$K$24,2,0),"NPROD"))[/COLOR]
 
Upvote 0
Just nest another level of IF on to the beginning like I did with the last one.
Give it a try and see how you do. It will be a good test to see if you understand what I did the first time.
Post back with what you tried if you run into trouble.
 
Upvote 0
ok, I have gotten it to read the cell and identify Z in second position, and write TSO by using

MID(H2,2,1)="Z","TSO")

I added it to the formula you provided and I get error

=IF(OR(mid(H2,2,1)="Z","TSO"),(LEFT(H2,1)="T",LEFT(H2,1)="U"),IFNA(VLOOKUP(H2,$M$7:$N$26,2,0),"NPROD"),IFNA(VLOOKUP(H2,$M$7:$N$26,2,0),"PROD"))
 
Upvote 0
No you cannot put it in that OR statement. You need to put it another nested IF statement, i.e.
Code:
[COLOR=#333333]=[/COLOR][COLOR=#ff0000]IF(MID(H2,2,1)="Z","TSO",[/COLOR][COLOR=#333333][FONT=Verdana]IF(OR(LEFT([/FONT][/COLOR][COLOR=#333333][FONT=Verdana][@Column1],1)="T",[/FONT][/COLOR][COLOR=#333333][FONT=Verdana]LEFT([/FONT][/COLOR][COLOR=#333333][FONT=Verdana][@Column1],1)="U"),[/FONT][/COLOR][COLOR=#333333][FONT=Verdana]IFNA(VLOOKUP([@Column1],$J$3:$K$24,2,0),"NPROD"),[/FONT][/COLOR][FONT=Verdana]IFNA(VLOOKUP([@Column1],$J$3:$K$24,2,0),"PROD"))[COLOR=#ff0000])[/COLOR][/FONT]
So, think of it this way. You are first checking the 2nd character of H2 and if it is "Z" then return "TSO". Otherwise, return out other calculation we created previously.
 
Last edited:
Upvote 0
Thank you I had tried a few scenarios and on one of them I had similar to what you wrote but for got the IF before the OR. work perfect.... Once again thank you for your help.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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