Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default Need 7 digit number with differnt number of leading zeros

Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Need 7 digit number with differnt number of leading zeros

On Jul 30, 11:43*am, malycom
wrote:
Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. *The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as *0003128 right
through to 0999999 and again, everything in between. *Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost..

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. *I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm


Hi Malcolm,

This basic but it will work. Format a column as text and enter this
formula then copy down the required number of rows

=IF(LEN(A1)=4,"000"&A1,IF(LEN(A1)=5,"00"&A1,IF(LEN (A1)
=6,"0"&A1,A1)))

(Where the numbers are in column A)

Hope this helps

Paul

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 117
Default Need 7 digit number with differnt number of leading zeros

Highlight all the cells and then select Format - Cells
Custom and enter into the type box where it says general, 0000000

"malycom" wrote:

Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Need 7 digit number with differnt number of leading zeros

=TEXT(A1,"0000000")
creates the required string in a helper column, then format the original
column like text and CopyPasteSpecial/Values the helper column to the
original column and delete the helper column!

Regards,
Stefi


€˛malycom€¯ ezt Ć*rta:

Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default Need 7 digit number with differnt number of leading zeros

Many thanks - That worked a treat.

The crazy thing is I was convinced I tried that several times.

Once again, thanks very much.

Malcolm

"RonaldoOneNil" wrote:

Highlight all the cells and then select Format - Cells
Custom and enter into the type box where it says general, 0000000

"malycom" wrote:

Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default Need 7 digit number with differnt number of leading zeros

Hi, thanks for your input but I tried Ronaldo's suggestion first and it worked.

I appreciate your assisting though.

Regards

Malcolm

"PMC1" wrote:

On Jul 30, 11:43 am, malycom
wrote:
Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost..

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm


Hi Malcolm,

This basic but it will work. Format a column as text and enter this
formula then copy down the required number of rows

=IF(LEN(A1)=4,"000"&A1,IF(LEN(A1)=5,"00"&A1,IF(LEN (A1)
=6,"0"&A1,A1)))

(Where the numbers are in column A)

Hope this helps

Paul


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Need 7 digit number with differnt number of leading zeros

If you are looking to convert the below data in Col A to that in colB; try
the below formula in Cell B1 and copy down

=TEXT(LEFT(A1,FIND("-",A1)-1)+0,"0000000") & " - " &
TEXT(MID(A1,FIND("-",A1)+1,10)+0,"0000000")

ColA COLB
3128 - 9999 0003128 - 0009999
10000 - 99999 0010000 - 0099999
100000 - 999999 0100000 - 0999999


If this post helps click Yes
---------------
Jacob Skaria


"malycom" wrote:

Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Need 7 digit number with differnt number of leading zeros

It isn't sure that your solution meets the OP's requirement! It shall display
the required format, but cell value remains a number and won't match a 7
digit string identifier!

Stefi


€˛RonaldoOneNil€¯ ezt Ć*rta:

Highlight all the cells and then select Format - Cells
Custom and enter into the type box where it says general, 0000000

"malycom" wrote:

Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits and 1
leading zero for the numbers with 6 digits. I desperately need this sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Need 7 digit number with differnt number of leading zeros

Format as 0000000 if you want it still to be a number.
Use the formula =TEXT(A1,"0000000") if you want text.
--
David Biddulph

"malycom" wrote in message
...
Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I
saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits
and 1
leading zero for the numbers with 6 digits. I desperately need this
sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default Need 7 digit number with differnt number of leading zeros

Thanks everyone for your input. I only opened the file in Excel but it is
not saved as an excel spreadsheet. It is saved as an .req file which is a
kind text file used by a program we use to run daily downloads.

The cutom filed 0000000 works fine for my needs. It was a panic situation
as opening originally in Excel deleted all leading zeros which I hadn't
noticed when saving.

However, everything is sorted now.

Thanks to you all

Malcolm

"David Biddulph" wrote:

Format as 0000000 if you want it still to be a number.
Use the formula =TEXT(A1,"0000000") if you want text.
--
David Biddulph

"malycom" wrote in message
...
Hi

I have a single column of data of ascending numbers which was in an .req
file format (text) which I opened in Excel. The lowest number is 3128 and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128 right
through to 0999999 and again, everything in between. Unfortunately, I
saved
the changes I made in the spreadsheet and all the leading zeros were lost.

I can not for the life of me find anyway of getting 3 leading zeros to all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits
and 1
leading zero for the numbers with 6 digits. I desperately need this
sorted
as these numbers are unique identifiers for a download that occurs daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm






  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Need 7 digit number with differnt number of leading zeros

If you use Excel to read in a text file and you want Excel to treat the
input as text, you need to tell Excel (in the text import wizard) that the
data in the relevant column as text, not as general or number.
--
David Biddulph

"malycom" wrote in message
...
Thanks everyone for your input. I only opened the file in Excel but it is
not saved as an excel spreadsheet. It is saved as an .req file which is a
kind text file used by a program we use to run daily downloads.

The cutom filed 0000000 works fine for my needs. It was a panic situation
as opening originally in Excel deleted all leading zeros which I hadn't
noticed when saving.

However, everything is sorted now.

Thanks to you all

Malcolm

"David Biddulph" wrote:

Format as 0000000 if you want it still to be a number.
Use the formula =TEXT(A1,"0000000") if you want text.
--
David Biddulph

"malycom" wrote in message
...
Hi

I have a single column of data of ascending numbers which was in an
.req
file format (text) which I opened in Excel. The lowest number is 3128
and
the largest number is 999999 with all numbers in between.

These numbers were all 7 digits with leading zeros such as 0003128
right
through to 0999999 and again, everything in between. Unfortunately, I
saved
the changes I made in the spreadsheet and all the leading zeros were
lost.

I can not for the life of me find anyway of getting 3 leading zeros to
all
the numbers with 4 digits, 2 leading zero for the numbers with 5 digits
and 1
leading zero for the numbers with 6 digits. I desperately need this
sorted
as these numbers are unique identifiers for a download that occurs
daily.

0003128 - 0009999
0010000 - 0099999
0100000 - 0999999

Is there anybody who can help me to convert these numbers back to their
original format.

Thanks in advance

Malcolm






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
hyphenated number format with leading zeros to the right of the hy CJ Excel Discussion (Misc queries) 4 November 17th 05 02:18 PM
Spliting a number with leading zeros haitch2 Excel Discussion (Misc queries) 7 September 30th 05 12:09 AM
putting leading zeros in front of number caroline argyle Excel Discussion (Misc queries) 2 August 2nd 05 01:59 PM
retain leading zeros in number format Jeff Excel Discussion (Misc queries) 5 February 22nd 05 09:24 PM
How to add leading 0 to four digit number? Calendar Control Excel Worksheet Functions 2 December 30th 04 09:53 PM


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

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"