ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Right function variable length (https://www.excelbanter.com/excel-worksheet-functions/222560-right-function-variable-length.html)

lundquic

Right function variable length
 
I have a column of data that looks like:

54432\27982\UNIV 20080701

I am looking to remove everything to the right of the second \. The length
of those charaters is variable. I know this is an easy one but I can not
seem to get it to work.

Thanks for the help

Mike

Luke M

Right function variable length
 
To extract everything to the right:
=RIGHT(A2,LEN(A2)-FIND("\",A2,FIND("\",A2)+1))
To get rid of everything to the right:
=LEFT(A2,FIND("\",A2,FIND("\",A2)+1))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"lundquic" wrote:

I have a column of data that looks like:

54432\27982\UNIV 20080701

I am looking to remove everything to the right of the second \. The length
of those charaters is variable. I know this is an easy one but I can not
seem to get it to work.

Thanks for the help

Mike


T. Valko[_2_]

Right function variable length
 
Assuming there is *always* 2 \ in the string:

=MID(A1,FIND("\",A1,FIND("\",A1)+1)+1,255)

--
Biff
Microsoft Excel MVP


"lundquic" wrote:

I have a column of data that looks like:

54432\27982\UNIV 20080701

I am looking to remove everything to the right of the second \. The length
of those charaters is variable. I know this is an easy one but I can not
seem to get it to work.

Thanks for the help

Mike


Jarek Kujawa[_2_]

Right function variable length
 
=RIGHT(RIGHT(A1,LEN(A1)-FIND("\",A1,1)),LEN(RIGHT(A1,LEN(A1)-FIND
("\",A1,1)))-FIND("\",RIGHT(A1;LEN(A1)-FIND("\",A1,1)),1))

pls click YES if it helped you



On 27 Lut, 17:54, lundquic wrote:
I have a column of data that looks like:

54432\27982\UNIV 20080701

I am looking to remove everything to the right of the second \. *The length
of those charaters is variable. *I know this is an easy one but I can not
seem to get it to work.

Thanks for the help

Mike



Bernie Deitrick

Right function variable length
 
Mike,

=LEFT(A2,FIND("\",A2,FIND("\",A2)+1)-1)

or

=LEFT(A2,FIND("\",A2,FIND("\",A2)+1))

depending on whether you want the final \ or not.

HTH,
Bernie
MS Excel MVP


"lundquic" wrote in message
...
I have a column of data that looks like:

54432\27982\UNIV 20080701

I am looking to remove everything to the right of the second \. The
length
of those charaters is variable. I know this is an easy one but I can not
seem to get it to work.

Thanks for the help

Mike



Ron Rosenfeld

Right function variable length
 
On Fri, 27 Feb 2009 08:54:14 -0800, lundquic
wrote:

I have a column of data that looks like:

54432\27982\UNIV 20080701

I am looking to remove everything to the right of the second \. The length
of those charaters is variable. I know this is an easy one but I can not
seem to get it to work.

Thanks for the help

Mike


Will the 2nd "\" always be the last "\"? If so, try:

=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",99)),99))

--ron


All times are GMT +1. The time now is 01:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com