Home > Excel > Left Padding Zeros in Excel

Left Padding Zeros in Excel

Here’s a quick equation to use in Excel if you’re trying to pad a number out to the left.  For instance, you have “427″ and you really want it to be “0000427″:

=TEXT(A1,"0000000")

=TEXT(A1,"0000000")

 

 

 

The TEXT function has a few more tricks up it’s sleeve.  Here’s a link to more details on it:  http://www.techonthenet.com/excel/formulas/text.php

About these ads
Categories: Excel Tags: , ,
  1. Tim
    27 July 2012 at 18:19 | #1

    Or you could just use the Format Cell option ->Custom-> “0000000″. Good to know that text formula though too!

  2. hurls
    23 August 2012 at 15:46 | #2

    Tim, that’s true; however, it doesn’t change the underlying data, it’s simply how it’s displayed. Thus, if you were to save the file off as a csv, then you’d lose the leading 0′s.

  3. Rok
    23 March 2013 at 04:57 | #3

    10x, great hint!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 899 other followers

%d bloggers like this: