Nested if vlookup

xrprrp

New Member
Joined
Dec 17, 2018
Messages
4
Hi,

I am having a problem writing a nested IF with a VLOOKUP.

I have Columns D to O as my table array, with a text string in Col D of which I need to look up "leisure" "business" or "personal".

I then need the result of the formula to put which ever of these text options that appear in the text string in Col D in Col P.

Any help will be greatly appreciated!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
=iferror(vlookup(...),iferror(vlookup(...),iferror(vlookup(...),"DATA NOT FOUND")))
 
Last edited:
Upvote 0
In Col D it has a text string like [TABLE="width: 1415"]
<colgroup><col width="1415" style="width: 1061pt;"></colgroup><tbody>[TR]
[TD="width: 1415"]PD~BusinessDubrovnikLaneDE_CH~DISPLAY_PB_FM~BAN_DT~CROSS_AS~DCMJIVOX_IT~POE_DA~SDBM_DS~MLT_SS~_TG~BHV_TS~PRO_SZ~160X600_AD~SSCLICK_RT~DCPM_VV~VGPMX70IAS[/TD]
[/TR]
</tbody>[/TABLE]

I need to extract whether it says "Business" "Leisure" "Couples" "Family" from this text string and depending on which one have that entered into col P

I tried =IF(VLOOKUP("leisure",D:O,1,TRUE)="leisure",leisure,IF(VLOOKUP

and repeating it for each word but didn't work?
 
Upvote 0
Well, no that wont work, since you never said the tables contain other data and that the string to lookup is only PART of that data.
You cant use VLOOKUP like that, you were the one that selected VLOOKUP.

Will try and find another way...
 
Last edited:
Upvote 0
Are you trying to check row by row? ie if D2 has Leisure then P2 has leisure
 
Upvote 0
Hi,

You can do it 2 ways.

1. "hard code" the table in the formula, as shown in P1.
2. Create a Table with the LOOKUP values, probably a better way to go, since you can easily change the table values, as shown in Q1.

Either formula copied down.


Book1
DPQRST
1PD~BusinessDubrovnikLaneDE_CH~DISPLAY_PB_BusinessBusinessTableBusiness
2PD~FamilyDubrovnikLaneDE_CH~DISPLAY_PB_FamilyFamilyLeisure
3PD~CouplesDubrovnikLaneDE_CH~DISPLAY_CouplesCouplesCouples
4Family
Sheet405
Cell Formulas
RangeFormula
P1=LOOKUP(2,1/SEARCH({"Business","Leisure","Couples","Family"},D1),{"Business","Leisure","Couples","Family"})
Q1=LOOKUP(2,1/SEARCH(T$1:T$4,D1),T$1:T$4)


EDIT: I've shortened your Text strings for my sample above, as it wasn't showing properly due to it's length.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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