#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Trim if?

How can I TRIM i.e. remove the first 3 numbers in a column of data (all
rows) if the leading 3 numbers are 123, and replace them with 9

so for example: if my existing number is 123987654 replace with 9987654

Thanks



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scoops
 
Posts: n/a
Default Trim if?


John wrote:
How can I TRIM i.e. remove the first 3 numbers in a column of data (all
rows) if the leading 3 numbers are 123, and replace them with 9

so for example: if my existing number is 123987654 replace with 9987654

Thanks


Hi John

Try:

=IF(LEFT(A1,3)="123",9&MID(A1,4,LEN(A1))*1)

Regards

Steve

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Trim if?

On the money Scoops, Thanks


"Scoops" wrote in message
oups.com...

John wrote:
How can I TRIM i.e. remove the first 3 numbers in a column of data (all
rows) if the leading 3 numbers are 123, and replace them with 9

so for example: if my existing number is 123987654 replace with 9987654

Thanks


Hi John

Try:

=IF(LEFT(A1,3)="123",9&MID(A1,4,LEN(A1))*1)

Regards

Steve



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Marcelo
 
Posts: n/a
Default Trim if?

Hi John

try =9&right(a3,len(a3)-3) and copy it down

HTH
Regards from Brazil
Marcelo



"John" escreveu:

How can I TRIM i.e. remove the first 3 numbers in a column of data (all
rows) if the leading 3 numbers are 123, and replace them with 9

so for example: if my existing number is 123987654 replace with 9987654

Thanks




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scoops
 
Posts: n/a
Default Trim if?


John wrote:
How can I TRIM i.e. remove the first 3 numbers in a column of data (all
rows) if the leading 3 numbers are 123, and replace them with 9

so for example: if my existing number is 123987654 replace with 9987654

Thanks


Or

=IF(LEFT(A1,3)="123",9&MID(A1,4,LEN(A1))*1,A1)

to retain the original value if it doesn't start "123"

Regards

Steve



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
oteixeira
 
Posts: n/a
Default Trim if?


Try this formula:


=IF(LEFT(H17,3)="123",MID(H17,4,LEN(H17-3)),H17)

Hope it helps


--
oteixeira
------------------------------------------------------------------------
oteixeira's Profile: http://www.excelforum.com/member.php...o&userid=35320
View this thread: http://www.excelforum.com/showthread...hreadid=555618

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Trim if?

Thanks all


"oteixeira" wrote
in message ...

Try this formula:


=IF(LEFT(H17,3)="123",MID(H17,4,LEN(H17-3)),H17)

Hope it helps


--
oteixeira
------------------------------------------------------------------------
oteixeira's Profile:
http://www.excelforum.com/member.php...o&userid=35320
View this thread: http://www.excelforum.com/showthread...hreadid=555618



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
Code for Trim function shaji Excel Discussion (Misc queries) 2 June 15th 06 09:38 AM
Trim Cells aftamath Excel Discussion (Misc queries) 1 October 18th 05 04:06 PM
Trim and Keep the Trimmed Data sally t Excel Worksheet Functions 2 July 26th 05 02:29 PM
Trim function doesn't clean out ASCII Code 160 (Space) Ronald Dodge Excel Worksheet Functions 6 January 27th 05 03:48 AM
How to use TRIM function Sky Warren Excel Worksheet Functions 3 January 8th 05 05:06 PM


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