Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a left pad formula method
I am using Windows XP and Office 2003.
I need a formula to left pad some ID numbers that contain both letters and numbers and can be from three to seven characters in length so that all IDs have ten characters. This conversion will occur in another column. For example: 8912 would become 0000008912 42138A would become 000042138A I tried: =Text(A1, "0000000") and this works great when the ID is all numbers, but this fails if letters are involved. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a left pad formula method
Hi,
Assuming the originals are in Column A and you want the padded version in column B this should work (you may have to format both columns as text) =REPT("0",10-LEN(A1))&A1 HTH, OJ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a left pad formula method
That works great! Thanks OJ! - and good night.
"OJ" wrote: Hi, Assuming the originals are in Column A and you want the padded version in column B this should work (you may have to format both columns as text) =REPT("0",10-LEN(A1))&A1 HTH, OJ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a left pad formula method
(you may have to format both columns as text)
Just to add then: You don't need to format either column as text. the results will be text irrespective of formatting. -- Regards, Tom Ogilvy "OJ" wrote in message oups.com... Hi, Assuming the originals are in Column A and you want the padded version in column B this should work (you may have to format both columns as text) =REPT("0",10-LEN(A1))&A1 HTH, OJ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Method 'Left' of object 'DataLabel' failed | Charts and Charting in Excel | |||
Please post this thread a correct full method, method about | New Users to Excel | |||
Please post this thread a complete correct method, method about te | New Users to Excel | |||
Array Formula - using LEFT("text",4) in formula | Excel Worksheet Functions | |||
formula or method needed | Excel Programming |