SOLVED

Using VLOOKUP to split a text string

Copper Contributor

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.

3 Replies
best response confirmed by Steve Weaver (Copper Contributor)
Solution

@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)
Thank you Patrick2788! :clapping_hands:
You're welcome!
1 best response

Accepted Solutions
best response confirmed by Steve Weaver (Copper Contributor)
Solution

@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)

View solution in original post