ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Insert Leading Characters If String Is Only 7 Characters (https://www.excelbanter.com/excel-discussion-misc-queries/228390-insert-leading-characters-if-string-only-7-characters.html)

Paperback Writer

Insert Leading Characters If String Is Only 7 Characters
 
I need to insert a leading zero. But, I only need it in the event that the
string is only 7 or fewer characters.

3032009 would become 03032009
12122008 would remain 12122008

Thank you!!!

dan

Insert Leading Characters If String Is Only 7 Characters
 
In B1, use the formula =text(a1,"0000000")


"Paperback Writer" wrote:

I need to insert a leading zero. But, I only need it in the event that the
string is only 7 or fewer characters.

3032009 would become 03032009
12122008 would remain 12122008

Thank you!!!


David Biddulph[_2_]

Insert Leading Characters If String Is Only 7 Characters
 
=TEXT(A2,"00000000") if you want it as text, or format the display as
00000000
--
David Biddulph

Paperback Writer wrote:
I need to insert a leading zero. But, I only need it in the event
that the string is only 7 or fewer characters.

3032009 would become 03032009
12122008 would remain 12122008

Thank you!!!





All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com