If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Delete all records after "/"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-27-10, 07:08
akhlaq768 akhlaq768 is offline
Registered User
 
Join Date: Oct 2007
Posts: 127
Delete all records after "/"

I've been asked to remove all the character that appear after the following sign "/"

So "D600/1" Should become "D600" and "D241/5" should become "D241"

So i thought my formula would look something like this

=IF(A2, "/", then LEFT(A2, 4) ELSE, A2)

will this work

please see attached excel for example
Attached Files
File Type: zip Book1.zip (2.5 KB, 10 views)
Reply With Quote
  #2 (permalink)  
Old 05-27-10, 08:33
Ax238 Ax238 is offline
Registered User
 
Join Date: May 2009
Posts: 257
Hello,

You can use the following formula:
Code:
=IF(ISERROR(FIND("/",A2)),A2,LEFT(A2,FIND("/",A2)-1))
Regards,

Ax
Reply With Quote
  #3 (permalink)  
Old 05-27-10, 08:42
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Hi akhlaq768,
Quote:
So i thought my formula would look something like this

=IF(A2, "/", then LEFT(A2, 4) ELSE, A2)
That formula's not quite right... it's a bit of a formula / VB combination!

I can't download your attachment - the zip file seems to be corrupted - but I think a formula that would suit you is this:
Code:
=LEFT(A2,SEARCH("/",A2&"/")-1)

Alternatively, if you don't want to keep the original data and just want to remove the unwanted characters in situ, then the Text To Columns feature would be a quick and easy option.
Select the range > Data > Text To Columns > Delimited > Other = / > Select the 2nd column in the data preview pane and choose Do Not Import > Finish.


Hope that helps...
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #4 (permalink)  
Old 05-28-10, 08:43
akhlaq768 akhlaq768 is offline
Registered User
 
Join Date: Oct 2007
Posts: 127
thanks guys this is perfect
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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