Forum Discussion
Steve Weaver
Jun 20, 2023Copper Contributor
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.
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)
- Patrick2788Silver Contributor
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)
- Steve WeaverCopper ContributorThank you Patrick2788! 👏
- Patrick2788Silver ContributorYou're welcome!