Vlookup or Index/match with roman numbers

mrichard

New Member
Joined
Mar 23, 2020
Messages
29
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I have tried both vlookup and index/match formulas to pull data and it keeps pulling the first match each time.
Example:

Table:
Network Engineer I
Network Engineer II
Network Engineer III
System Engineer I
System Engineer II
System Engineer III

My formula is -
=VLOOKUP("*"&C37&"*",'Sheet 1 GSA'!$B$2:$L$40,2,FALSE)
and also used -
=INDEX('Sheet 1 GSA'!C:C,MATCH("*"&C37&"*",'Sheet 1 GSA'!B:B,0))

The data I am looking for is staked in two different cells (in other words I have several labor categories in two different cells - using the alt return to place on top of one another). One cell has 5 lcats and it contains the Network Engineer III . The other cell contains the Network Engineer I and II. Both formulas sort of work but they are pulling the Network Engineer III because its the first that it sees.

Anybody have a work around.

Thanks in advance

Mark

 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Mark, you are making life challenging by having multiple data elements in one cell. Using Alt Return is ok if its a note or something similar, but as soon as you want to manipulate the individual data elements you run into this sort of difficult.

That said, it doesn't sound like an impossibility, my first thought would be to try this:

VLOOKUP("*" & C37 & CHAR(10) & "*", Sheet 1 GSA'!$B$2:$L$40, 2, FALSE)

The reason that your code returned the wrong result was because 'Network Engineer I' is actually part of 'Network Engineer III' (at least as far as the computer is concerned. The solution works by looking for the Alt-Return character. However, this will run into problems if you haven't put Alt-Return at the end of list of entries. A tidier solution would be after each entry put a comma before the Alt-Return. The formula above would then become:

VLOOKUP("*" & C37 & ",*", Sheet 1 GSA'!$B$2:$L$40, 2, FALSE)

HTH
 
Upvote 0
Peter,

Bingo! thanks a bunch. Would of never thought to put a comma in there.

Much appreciated
Mark
 
Upvote 0
It might work this time, but as Peter has already said, you're making things far more complicated than you need to by using bad practice.
The other cell contains the Network Engineer I and II.
Stick to one in each cell and it will make things a lot easier. It would be better to adopt a more normailsed approach now rather than leaving it til later. You will inevitably reach a point where a workaround is not possible and you have to reformat it, at which point you will have to redo all of your workarounds to match the corrected layout.

With a normalised layout, you would have most likely had a vlookup formula working an a couple of minutes, how much extra time have you lost trying to make it work?
 
Upvote 0
Thanks for the Feedback Mark, much appreciated - but do note Jason's comments also. It'll be worth it.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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