#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SJS SJS is offline
external usenet poster
 
Posts: 20
Default Data cleanup

I am importing data from a website into a SS and I have a field I need to
cleanup so I can run a vlookup against it. The data comes over three ways
and looks like this:

ex1: word1 word2 , other words; I need 'word1 word2'
ex2: word1 word2 1, other words; I need 'word1 word2'
ex3: word1, other words; I need 'word1'

I'm interested in the data left of the comma and I need to strip any
trailing spaces and the ' 1' (space 1). I'm getting close by: Data-Text to
Columns and using the comma delimiter THEN find/replace 'space 1' w/nothing.
But I am left with some cells that have a trailing space (example 1 above).
I ran the Trim function but it's not removing the trailing space.

Any help would be greatly appreciated.

tks,
steve


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Data cleanup

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


"sjs" wrote:

I am importing data from a website into a SS and I have a field I need to
cleanup so I can run a vlookup against it. The data comes over three ways
and looks like this:

ex1: word1 word2 , other words; I need 'word1 word2'
ex2: word1 word2 1, other words; I need 'word1 word2'
ex3: word1, other words; I need 'word1'

I'm interested in the data left of the comma and I need to strip any
trailing spaces and the ' 1' (space 1). I'm getting close by: Data-Text to
Columns and using the comma delimiter THEN find/replace 'space 1' w/nothing.
But I am left with some cells that have a trailing space (example 1 above).
I ran the Trim function but it's not removing the trailing space.

Any help would be greatly appreciated.

tks,
steve


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
Cleanup worksheets from 97-2003 to work properly on Excel 2007 Santiago C Excel Worksheet Functions 0 December 8th 08 05:43 PM
Pivot Table Cleanup tommcbrny Excel Discussion (Misc queries) 3 October 22nd 08 09:05 PM
Can someone help Cleanup my recorded macro Kelly******** Excel Discussion (Misc queries) 0 April 18th 08 07:51 PM
recently used files, cleanup Patricia Shannon Excel Discussion (Misc queries) 0 April 4th 06 11:19 PM
Windows XP Disc Cleanup Dog Koala New Users to Excel 1 May 27th 05 03:37 PM


All times are GMT +1. The time now is 02:30 AM.

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

About Us

"It's about Microsoft Excel"