• This topic has 23 replies, 13 voices, and was last updated 8 years ago by benp1.
Viewing 24 posts - 1 through 24 (of 24 total)
  • Simple (to an expert) Excel question
  • welshfarmer
    Full Member

    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?

    oliverracing
    Full Member

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

    welshfarmer
    Full Member

    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)

    jambalaya
    Free Member

    Type a single quote, ie a ‘ before you type the number in

    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

    mikewsmith
    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)

    welshfarmer
    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

    jambalaya
    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.

    jambalaya
    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 !

    jambalaya
    Free Member

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

    jambalaya
    Free Member

    5 posts from me in a row – where’s Junkyard ?

    PlopNofear
    Free Member

    Make a new column with:

    =”0″&(your_cell)

    Then drag down?

    mikewsmith
    Free Member

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

    You don’t know who you are dealing with….

    WackoAK
    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.

    T1000
    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

    nickdavies
    Full 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.

    slowoldman
    Full Member

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

    jambalaya
    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

    verses
    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 🙂

    welshfarmer
    Full Member

    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. 🙂

    cokie
    Full Member

    All’s wool that ends wool.

    welshfarmer
    Full Member

    I see what you did there Cokie 🙂

    Where is the “slaps forehead” emoticon

    beardo74
    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…….

    benp1
    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 ![/quote]

    😆 😆 😆 😆

Viewing 24 posts - 1 through 24 (of 24 total)

The topic ‘Simple (to an expert) Excel question’ is closed to new replies.