Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to get rest of characters after last certain character?

Hi All,


e.g. In cell A1 there is a string = "dummy1\dummy3\cat\test"

In cell B1 I want result = "test"

In pseudo code:

test = functionX("dummy1\dummy3\cat\test"; "\" )

I don't want write visual basic code just use normal excel functions.

Is it possible to write this kind of function?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to get rest of characters after last certain character?

Use INSTRREV

string = "dummy1\dummy3\cat\test"
string = mid(string,instrrev(string,"\") + 1)

The instrrev will find the position of the last back slash in the
string. You add one to get everything after the last back slash.


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=158814

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default How to get rest of characters after last certain character?

On Wed, 2 Dec 2009 05:20:37 -0800 (PST), Wille wrote:

Hi All,


e.g. In cell A1 there is a string = "dummy1\dummy3\cat\test"

In cell B1 I want result = "test"

In pseudo code:

test = functionX("dummy1\dummy3\cat\test"; "\" )

I don't want write visual basic code just use normal excel functions.

Is it possible to write this kind of function?


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

--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to get rest of characters after last certain character?

On 2 joulu, 15:45, Ron Rosenfeld wrote:
On Wed, 2 Dec 2009 05:20:37 -0800 (PST), Wille wrote:
Hi All,


e.g. In cell A1 there is a string = "dummy1\dummy3\cat\test"
In cell B1 I want result = "test"


In pseudo code:


test = functionX("dummy1\dummy3\cat\test"; "\" )


I don't want write visual basic code just use normal excel functions.


Is it possible to write this kind of function?


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


Thank you very much. This solved problem.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get characters on left of specified character in Excel Murugan Excel Discussion (Misc queries) 3 April 2nd 23 04:15 PM
how to select the first character in a cell and delete the rest Helenf Excel Worksheet Functions 4 May 14th 09 12:10 PM
Extract numeric characters plus one character... KLZA Excel Worksheet Functions 14 February 4th 09 03:23 AM
Counting # of characters before a certain character NickPro72 Excel Discussion (Misc queries) 4 August 22nd 08 09:17 PM
Remove all characters following the first character in a string RC Excel Discussion (Misc queries) 5 August 30th 05 03:17 AM


All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"