Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default removing zeroes almost perfect

Hi I am using this to convert BHQ0009540 to C9540

=CONCATENATE("C",MID(RIGHT(B2,7),SEARCH(LEFT(SUBST ITUTE(RIGHT(B2,7),"0",""),
1),RIGHT(B2,7)),25))

the issue is sometimes i need a leading 0 like converting LPB0000385
to C0385. using the above I get C385.

I am at a loss. any ideas?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 620
Default removing zeroes almost perfect

On 26/07/2011 20:55, pat67 wrote:
Hi I am using this to convert BHQ0009540 to C9540

=CONCATENATE("C",MID(RIGHT(B2,7),SEARCH(LEFT(SUBST ITUTE(RIGHT(B2,7),"0",""),
1),RIGHT(B2,7)),25))

the issue is sometimes i need a leading 0 like converting LPB0000385
to C0385. using the above I get C385.

I am at a loss. any ideas?

Thanks


="C"&TEXT(RIGHT(B2,7),"0000") if this suits the input format.

--
David Biddulph
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default removing zeroes almost perfect

="C"&TEXT(RIGHT(B2,7),"0000") if this suits the input format.

If you do that formula this way instead...

=TEXT(RIGHT(B2,7),"C0000")

then you will be able to copy it down through Column B cells that are blank
and not end up printing out that lone "C" character.

Rick Rothstein (MVP - Excel)

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 many perfect score James Excel Discussion (Misc queries) 3 June 23rd 08 06:00 PM
How to fit each cell into a perfect square? Eric Excel Discussion (Misc queries) 3 September 21st 07 07:15 AM
Making the perfect sort. HoganD87 Excel Discussion (Misc queries) 1 September 11th 07 11:14 PM
searching for my perfect algorithm.... meesh7391 Excel Discussion (Misc queries) 0 January 11th 06 01:55 PM
looking for my perfect algorithm meesh7391 Excel Discussion (Misc queries) 0 January 11th 06 12:06 AM


All times are GMT +1. The time now is 06:40 PM.

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"