+ Reply to Thread
Results 1 to 3 of 3

How preserve leading zeros in sequential number part of document ref nr formula

  1. #1
    Registered User
    Join Date
    01-08-2013
    Location
    Reading, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question How preserve leading zeros in sequential number part of document ref nr formula

    Hi there, hoping some one can help:

    I have set up a filename builder where a user can pick a value for each code that forms part of a document reference number. the last part of this number is a sequential 4 digit number which increments automatically using an "if" formula by one digit each time. The sequential number then has leading zeroes to ensure that it appears as a 4 digit number. To do this set the custom format field to #### and this works fine so that 1 automatically becomes 0001, 20 becomes 0020, 999 becomes 0999, etc. However, when the following formula is applied to concatenate the codes into a document reference number, the sequential number loses its leading zeroes. E.g., a user selects the following codes:

    BR- 0300- 01- GF- DR- X- G13- 0002

    The formula used to join these up is:

    =B190&C190&D190&E190&F190&G190&H190&I190

    but the result I get is:

    BR-0300-01-GF-DR-X-G13-2 instead of BR-0300-01-GF-DR-X-G13-0002

    Note I am using google spreadsheets but the problem is the same in Excel. so how can I preserve the 4 digit sequential number in the resulting document reference number?

  2. #2
    Valued Forum Contributor
    Join Date
    09-17-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    454

    Re: How preserve leading zeros in sequential number part of document ref nr formula

    =b190&c190&d190&e190&f190&g190&h190&text(i190,"0000")

  3. #3
    Registered User
    Join Date
    01-08-2013
    Location
    Reading, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: How preserve leading zeros in sequential number part of document ref nr formula

    fantastic, that has worked exactly as I needed. Many thanks Cyiangou.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Preserve formatting Leading Zeros in CSV
    By rolta100 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-18-2014, 07:00 AM
  2. Preserve leading zeros in a varying length number when converting it to text
    By Paulymon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2013, 12:48 AM
  3. [SOLVED] CSV data has leading zeros - how can I open in Excel to preserve them?
    By Hang Glider in forum Excel General
    Replies: 4
    Last Post: 01-29-2013, 07:47 PM
  4. Formatting a Number with leading zeros
    By btamulis in forum Excel General
    Replies: 7
    Last Post: 02-11-2012, 12:09 PM
  5. Add varying number of leading zeros
    By santaklawze in forum Excel General
    Replies: 2
    Last Post: 09-29-2010, 10:47 AM
  6. Preserve leading zeros
    By BCRose in forum Excel General
    Replies: 3
    Last Post: 10-18-2009, 04:34 PM
  7. Spliting a number with leading zeros
    By haitch2 in forum Excel General
    Replies: 7
    Last Post: 09-29-2005, 07:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1