vlookup/search/find values within a text cell

TJ1982

New Member
Joined
Aug 22, 2019
Messages
2
Hi, Newbie tothe forum and basic Excel user.

From a text cell (Column A) I am struggling to extract the Cost Centre(Column B) and report the Project Name (Column C).

In the table below, I need to see if the values in column B "CostCentre" exist in any part of the cells in column A "Cost Code",and if they do then report the text in column C "Project".

i.e. does "100000" exist in any of the cells in column A, if so report"Project 1" in the relevant cells.

I don't think a simple vlookup or find/search formula can do this?

Is there a way it can be done backwards? i.e. vlookup if any of the valueswithin each cell in column A exist in column B, if they do report the correspondingvalue found in column C.

To be clear columns B and C are related to each other i.e.
Cost Centre 100000is Project 1.

Thanks in advance.



Tom.


Cost Code
Cost Centre
Project
16586/100000/54545
100000
Project 1
100006
100001
Project 2
16586 100002/54547
100002
Project 3
16586/100003/545HB
100003
Project 4
16586/100001/54549
100004
Project 5
16586 :100005/54550
100005
Project 6
16586/100004/54551
100006
Project 7
100008/54552
100007
Project 8
16586/100007/545.53
100008
Project 9
16586 /100009/54554
100009
Project 10
16586/100010/545.55
100010
Project 11
<tbody> </tbody>




 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I can't think of a simple way to do this, particularly as the inputs seem to follow an irregular pattern.

If you could write some rules to identify the cost centre within the inputs, then you could write a formula to isolate the cost centre from the inputs, and then lookup the cost centre against your reference table.

A possible rule to do this could be as follows
1) If the input contains the text string "/5", then take the preceding 6 digits as the cost centre.
2) If the input does NOT contain the text string "/5", then use the entire input as the cost centre.

This seems to be right for the sample data you provided, and if so it can be written as a formula.

QUESTION - is this ruleset correct for ALL your data ?
If yes, great, we can use that.
If no, is the amount of further variation small, so that we can adapt the ruleset to deal with one or two more variations ?
Or is the further variation huge, to the extent that it will not be possible to create a reliable ruleset in this way ?
 
Upvote 0
Thanks for the reply.

Unfortunately the variation is huge and un-uniform in its format. Isolating the cost centre is my challenge, which is why I was hoping there was a way to a type of reverse vlookup or find formula.
 
Upvote 0
One option, with a helper column

Book1
ABCDE
1Cost CodeCost CentreProject
216586/100000/54545100000Project 116586/100000/54545Project 1
3100006100001Project 216586/100001/54549Project 7
416586 100002/54547100002Project 316586 100002/54547Project 3
516586/100003/545HB100003Project 416586/100003/545HBProject 4
616586/100001/54549100004Project 516586/100004/54551Project 2
716586 :100005/54550100005Project 616586 :100005/54550Project 6
816586/100004/54551100006Project 7100006Project 5
9100008/54552100007Project 816586/100007/545.53Project 9
1016586/100007/545.53100008Project 9100008/54552Project 8
1116586 /100009/54554100009Project 1016586 /100009/54554Project 10
1216586/100010/545.55100010Project 1116586/100010/545.55Project 11
Program start
Cell Formulas
RangeFormula
E2=INDEX($C$2:$C$12,MATCH(A2,$D$2:$D$12,0))
D2{=INDEX($A$2:$A$12,MATCH("*"&B2&"*",$A$2:$A$12&"",0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,749
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