Mix of Vlookup, find and substitute

Cooki

New Member
Joined
Jul 31, 2018
Messages
44
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?
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,173
Office Version
2010
Platform
Windows
try Add your Lookup formula to
=LEFT(A8,FIND("*",SUBSTITUTE(A8,".","*",LEN(A8)-LEN(SUBSTITUTE(A8,".",""))))-1)
 

Cooki

New Member
Joined
Jul 31, 2018
Messages
44
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:

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,173
Office Version
2010
Platform
Windows
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:

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,173
Office Version
2010
Platform
Windows
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:

Cooki

New Member
Joined
Jul 31, 2018
Messages
44
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
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,624
Messages
5,512,465
Members
408,898
Latest member
Glenno557

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top