Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Truncate string

I want to truncate the portion of a string that follows my third "\".
So data looks like, C:\TEMP\RESULTS\FINANCE\3q\Findings and I want just
C:\TEMP\RESULTS\FINANCE\
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Truncate string

Your example does not match your request, but anyway:

s = "C:\TEMP\RESULTS\FINANCE\3q\Findings"
t = "\"
U = Split(s, t)
s = U(0) & t & U(1) & t & U(2) & t
--
Gary's Student


"bwmaher" wrote:

I want to truncate the portion of a string that follows my third "\".
So data looks like, C:\TEMP\RESULTS\FINANCE\3q\Findings and I want just
C:\TEMP\RESULTS\FINANCE\

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Truncate string

here's a formula that should work if the string is in A1

=LEFT(A1,FIND(CHAR(7),SUBSTITUTE(A1,"\",CHAR(7),3) ))
--


Gary


"bwmaher" wrote in message
...
I want to truncate the portion of a string that follows my third "\".
So data looks like, C:\TEMP\RESULTS\FINANCE\3q\Findings and I want just
C:\TEMP\RESULTS\FINANCE\



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Truncate string

Thank you, Gary. it worked perfectly.

"Gary Keramidas" wrote:

here's a formula that should work if the string is in A1

=LEFT(A1,FIND(CHAR(7),SUBSTITUTE(A1,"\",CHAR(7),3) ))
--


Gary


"bwmaher" wrote in message
...
I want to truncate the portion of a string that follows my third "\".
So data looks like, C:\TEMP\RESULTS\FINANCE\3q\Findings and I want just
C:\TEMP\RESULTS\FINANCE\




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
How do I truncate something like this? ckeys Excel Discussion (Misc queries) 6 December 30th 06 05:49 PM
TRUNCATE SPACE FROM NUMERICAL STRING eg "33 033 546" NAEEM Excel Worksheet Functions 8 December 5th 06 07:30 PM
Truncate/Mod Abode Excel Programming 9 May 19th 06 03:30 AM
How do you truncate a text string? dailygluttony Excel Worksheet Functions 2 March 28th 06 08:08 PM
Truncate Steven Excel Programming 11 April 20th 04 12:11 PM


All times are GMT +1. The time now is 01:28 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"