+ Reply to Thread
Results 1 to 3 of 3

Add zeros to cell to make same length

  1. #1
    Registered User
    Join Date
    06-07-2009
    Location
    london, england
    MS-Off Ver
    excel 2010
    Posts
    36

    Add zeros to cell to make same length

    Hi

    I have a range of columns with various text and value data that I need to concantenate. Each column needs to be a specific length e.g.

    Name Reference ouput required
    James A1234 00James0A1234
    Tom B102 0000Tom00B102

    i.e. Name needs to be 7 chars and reference 6 chars.

    Is there a formula that can do this?

    Thanks for your help.
    James

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Add zeros to cell to make same length

    With
    A1: a name...James
    B1: a reference...A1234
    This regular formula creates the structure you're looking for
    C1: =RIGHT("0000000"&A1,7)&RIGHT("000000"&B1,6)

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    06-07-2009
    Location
    london, england
    MS-Off Ver
    excel 2010
    Posts
    36

    Re: Add zeros to cell to make same length

    Ron, thanks that is perfect.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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