Mix of Vlookup, find and substitute

Cooki

Board Regular
Joined
Jul 31, 2018
Messages
86
Hi All

Have issues with this formula

=VLOOKUP(FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".","")))),Data!B:C,2,0)

What i want is to do a Vlookup on everything in the cell up to the full STOP (.).

This formula is giving me the position of the last full stop

FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))

but now i want to include vlookup everything up to the full stop

Any ideas?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
try Add your Lookup formula to
=LEFT(A8,FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))-1)
 
Upvote 0
1595428595183.png


Changed formula just for the screen shot

=VLOOKUP(FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".","")))),$A$16:$B$20,2,0)
 
Last edited:
Upvote 0
You left out part of the suggestion.
Try using Excel's Formula Evaluate.
The info below also shows an alternative
I just read your message again. You may not need the minus 1 since your Table has a decimal at the end.

T202007b.xlsm
ABCDE
8abc.def.a99899
5c
Cell Formulas
RangeFormula
B8B8=VLOOKUP(LEFT(A8,FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))-1),A16:B20,2,0)
C8C8=FIND("~",SUBSTITUTE(A8,".","~",2))
E8E8=VLOOKUP(LEFT(A8,FIND("~",SUBSTITUTE(A8,".","~",2))-1),A16:B20,2,0)


T202007b.xlsm
ABCDEF
8abc.def.a9999
5c
Cell Formulas
RangeFormula
B8B8=VLOOKUP(LEFT(A8,FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))),A16:B20,2,0)
E8E8=VLOOKUP(LEFT(A8,FIND("~",SUBSTITUTE(A8,".","~",2))),A16:B20,2,0)
 
Last edited:
Upvote 0
My suggestions assumed that there were 2 "." and you wanted to stop at the last "."

To post a clear example of your challenge with information that we can use, see the link to XL2BB.
T202007b.xlsm
ABCDE
8HT/HP Report:HHDC.XXXXXXX99991899
5c
Cell Formulas
RangeFormula
B8B8=VLOOKUP(LEFT(A8,FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))),A16:B20,2,0)
C8C8=VLOOKUP(LEFT(A8,FIND("~",SUBSTITUTE(A8,".","~",1))),A16:B20,2,0)
D8D8=FIND(".",A8,1)
E8E8=VLOOKUP(LEFT(A8,FIND(".",A8,1)),A16:B20,2,0)
 
Last edited:
Upvote 0
You left out part of the suggestion.
Try using Excel's Formula Evaluate.
The info below also shows an alternative
I just read your message again. You may not need the minus 1 since your Table has a decimal at the end.

T202007b.xlsm
ABCDE
8abc.def.a99899
5c
Cell Formulas
RangeFormula
B8B8=VLOOKUP(LEFT(A8,FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))-1),A16:B20,2,0)
C8C8=FIND("~",SUBSTITUTE(A8,".","~",2))
E8E8=VLOOKUP(LEFT(A8,FIND("~",SUBSTITUTE(A8,".","~",2))-1),A16:B20,2,0)


T202007b.xlsm
ABCDEF
8abc.def.a9999
5c
Cell Formulas
RangeFormula
B8B8=VLOOKUP(LEFT(A8,FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))),A16:B20,2,0)
E8E8=VLOOKUP(LEFT(A8,FIND("~",SUBSTITUTE(A8,".","~",2))),A16:B20,2,0)

Worked prefect thanks
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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