Simple (to an exper...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Simple (to an expert) Excel question

23 Posts
13 Users
0 Reactions
46 Views
Posts: 5720
Full Member
Topic starter
 

I am trying to type in and populate a list of consecutive numbers for animal eartags. However all the numbers start with a zero and it appears to be impossible to enter a number into an Excel (or Open Office) spreadsheet that begins with a zero. This number is essential though so there must be a way of getting it to stay there.

Any ideas?

EG tag number is 08607240790045
if I type that number in all I get is 8607240790045

sure there is a way to get the zero to stick?


 
Posted : 13/05/2015 9:21 am
Posts: 262
Full Member
 

Yep - format that cell as text (Format cell -> Number -> text)


 
Posted : 13/05/2015 9:24 am
Posts: 5720
Full Member
Topic starter
 

Hmmm I had tried that. It doesn't seem to work though. Should say, the numbers have to be then imported into a database so will need to behave as numbers (not sure if that is relevant though to the issue here)


 
Posted : 13/05/2015 9:28 am
Posts: 0
Free Member
 

[s]Type a single quote, ie a ' before you type the number in[/s]

Sorry that won't work as you want them to behave as numbers later in the database

What I think you need to do is type them in with a quote so you can see the zero - then use a formula in another cell to turn them into numbers so you can import those into the database, give me a second


 
Posted : 13/05/2015 9:29 am
Posts: 17
Free Member
 

ah this game.... yep text is one answer though it may cause you problems later on (played this game with my dad and his cattle tracking)


 
Posted : 13/05/2015 9:29 am
Posts: 3427
Full Member
Posts: 5720
Full Member
Topic starter
 

When I say it doesn't work. I can get the number to stay up with the zero at the start but I cannot then drag that number down to populate a list of 500 consecutive numbers


 
Posted : 13/05/2015 9:32 am
Posts: 0
Free Member
 

Type the numbers in with a quote ' (this forces the input to be treated as text)

then convert with VALUE( ) function

EG in cell A1 type '01234 in cell B1 type =VALUE(A1) ... use the B1 cell to import to database.


 
Posted : 13/05/2015 9:33 am
Posts: 0
Free Member
 

When I say it doesn't work. I can get the number to stay up with the zero at the start but I cannot then drag that number down to populate a list of 500 consecutive numbers

😀
Classic creeping functionality in an IT project specification - ask for one thing then expand requirements .. then complain that it doesn't work / contract price has gone up !


 
Posted : 13/05/2015 9:34 am
Posts: 0
Free Member
 

Do NOT use tag numbers starting with a zero = problem solved 😉


 
Posted : 13/05/2015 9:35 am
Posts: 0
Free Member
 

5 posts from me in a row - where's Junkyard ?


 
Posted : 13/05/2015 9:36 am
Posts: 0
Free Member
 

Make a new column with:

="0"&(your_cell)

Then drag down?


 
Posted : 13/05/2015 9:39 am
Posts: 17
Free Member
 

jambalaya - Member
Do NOT use tag numbers starting with a zero = problem solved

You don't know who you are dealing with....


 
Posted : 13/05/2015 9:39 am
Posts: 0
Free Member
 

the numbers have to be then imported into a database so will need to behave as numbers

The database field will have to be text as if it's a number format it will ignore the leading 0.


 
Posted : 13/05/2015 9:40 am
Posts: 0
Free Member
 

one way would be to

in cell A1

=CONCATENATE("0",B1)

Cell A1 formatted as text

In cell B1 8607240790045

fill down cells A1 & B1


 
Posted : 13/05/2015 9:45 am
Posts: 1299
Free Member
 

Are they all the same length?
If so select the column you are working on, select format cells and in the number tab you have a list of cell options.

Select 'special' and where there is a text box marked type: to the right, type in the number length as zeros (so for your example type 14 0's) then whatever number you put in there will extend the leading zero's to make it 14 long. If you were to drag down sequential numbers it puts the leading zeros in for you.

Have to do this all the time with our barcode numbers, works fine. A database will import them fine but won't always take those leading zero's into account though, so you might have to do a similar thing with that field to show them again if required. Easy enough in access, not sure on others.

Edit: img below shows where to go if you're not familiar with excel and you can see it working if you look at the cell and cell entry field.

[img] [/img]


 
Posted : 13/05/2015 9:45 am
Posts: 17779
Full Member
 

Use Custom Format "0"#
Put 08607240790045 in the first row, 08607240790046 in the second. Select both and drag down to fill rows.


 
Posted : 13/05/2015 9:46 am
Posts: 0
Free Member
 

What @T100 says will work for what you want as will @slow's solution but might be a bit complicated to do if you are not familiar with custom formatting


 
Posted : 13/05/2015 9:46 am
Posts: 3427
Full Member
 

as will @slow's solution but might be a bit complicated to do if you are not familiar with custom formatting

However if he follows the instructions I linked to (and ignores some of the waffle on there) then it's pretty straightforward 🙂


 
Posted : 13/05/2015 9:54 am
Posts: 5720
Full Member
Topic starter
 

WOW, I thought there would be some EXCEL love on here and you didn't dissapoint. Thanks for all the help guys. With a combination of your prompting and a bit of Googling I found a solution. Basically in Format >cell>number I clicked leading zeros back to zero and then forward again to 1. This gave a zero in the box next to it. I then typed # after the zero 15 times and it allowed me to keep the 16 figure number with a zero in front and I could drag down to populate the list. I have now sucessfully imported it to my database and it all matched the official eartag numbers so off to scan the lambs and see if there are any issues.

Thanks again for all the halp. This place is a veritable wikipedia of knowledge. 🙂


 
Posted : 13/05/2015 10:16 am
Posts: 2597
Free Member
 

All's wool that ends wool.


 
Posted : 13/05/2015 10:24 am
Posts: 5720
Full Member
Topic starter
 

I see what you did there Cokie 🙂

Where is the "slaps forehead" emoticon


 
Posted : 13/05/2015 12:05 pm
Posts: 0
Free Member
 

so off to scan the lambs and see if there are any issues.

So all your sheep have baa codes?

Sorry, I'll get my coat.......


 
Posted : 13/05/2015 12:31 pm
Posts: 5177
Full Member
 

When I say it doesn't work. I can get the number to stay up with the zero at the start but I cannot then drag that number down to populate a list of 500 consecutive numbers

Classic creeping functionality in an IT project specification - ask for one thing then expand requirements .. then complain that it doesn't work / contract price has gone up !

😆 😆 😆 😆


 
Posted : 13/05/2015 12:50 pm

6 DAYS LEFT
We are currently at 95% of our target!