Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default sorry i put wrongly for padded leading 0

dear all

this is to pad with trailing 0
=IF(D2<14, D2&REPT("0",14-LEN(D2)),D2)

why when i put in this way it doesn't seem to work?
=IF(D2<14, REPT("0",14-LEN(D2)&D2),D2)

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default sorry i put wrongly for padded leading 0

I suspect you IF condition is written improperly -- I think this is what you
want.
=IF(LEN(D2)<14,REPT("0",14-LEN(D2))&D2,D2)

--
Regards,
Tom Ogilvy

"tango" wrote in message
om...
dear all

this is to pad with trailing 0
=IF(D2<14, D2&REPT("0",14-LEN(D2)),D2)

why when i put in this way it doesn't seem to work?
=IF(D2<14, REPT("0",14-LEN(D2)&D2),D2)

thanks



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
Formulas calculate the answer wrongly as 0 Mary P Excel Worksheet Functions 1 December 8th 08 05:52 PM
Getting month padded zero kickyr Excel Discussion (Misc queries) 3 February 20th 06 03:01 PM
wrongly added or subtracted decimals ornithology 1 Excel Discussion (Misc queries) 2 January 15th 06 10:49 PM
Time displaying wrongly Denise Robinson Excel Discussion (Misc queries) 3 August 9th 05 02:30 PM
padded leading 0 tango Excel Programming 1 November 12th 04 12:22 AM


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