Forum Discussion

Steve Weaver's avatar
Steve Weaver
Copper Contributor
Jun 20, 2023
Solved

Using VLOOKUP to split a text string

I am using the formula =VLOOKUP($G3,'Quicken Portfolio'!$B$12:W38,9,FALSE) which returns 7.52-14.01. My issue is I need to expand the formula so that it will return only characters to the left of "-" which could be either 2 or 5 numbers.

  • Steve Weaver 

     

    With 365:

    =LET(result,VLOOKUP($G3,'Quicken Portfolio'!$B$12:$W$38,9,FALSE),TEXTBEFORE(result,"-"))

     

    Without 365:

    =LEFT(VLOOKUP($G3,'Quicken Portfolio'!$B$12:$W$38,9,FALSE),FIND("-",VLOOKUP($G3,'Quicken Portfolio'!$B$12:$W$38,9,FALSE))-1)
  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    Steve Weaver 

     

    With 365:

    =LET(result,VLOOKUP($G3,'Quicken Portfolio'!$B$12:$W$38,9,FALSE),TEXTBEFORE(result,"-"))

     

    Without 365:

    =LEFT(VLOOKUP($G3,'Quicken Portfolio'!$B$12:$W$38,9,FALSE),FIND("-",VLOOKUP($G3,'Quicken Portfolio'!$B$12:$W$38,9,FALSE))-1)

Resources