Find second to last value in cell

Find second to last value in cell

Post by RXJpY19 » Mon, 26 Apr 2010 21:44:02


Unless most "right" or "left" functions in which one is looking to select the
"LAST" or the "FIRST" value within a string of characters within a call, I
wish to select the "SECOND TO LAST" value within a string of characters
within a call. IN other words, assume the string of characters of a cell
ends with "Fname Lname". I wish to select "Fname" from the character string
and place it in another column. Any ideas? Much appreciated.
 
 
 

Find second to last value in cell

Post by VGVldGhsZX » Mon, 26 Apr 2010 22:05:01

=TRIM(LEFT(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),198),99))

 
 
 

Find second to last value in cell

Post by Roger Govi » Tue, 27 Apr 2010 01:04:44

Very nice solution, Teethless Mama!
 
 
 

Find second to last value in cell

Post by Bob Philli » Tue, 27 Apr 2010 01:49:07

Looks like overkill to me, the RIGHT seems superfluous as it seems fine to
just use

=TRIM(LEFT(SUBSTITUTE(A1," ",REPT(" ",99)),99))

--

HTH

Bob
 
 
 

Find second to last value in cell

Post by Bob Philli » Tue, 27 Apr 2010 01:50:06

Oops, my mistake, I missed the OPs request for Second to last :-)

--

HTH

Bob