Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to zero fill a number inside of an Excel cell

How do you zero fill a number to 10 positions inside an excel spreadsheet?

i.e. If cell A1 has 1234 how can cell A2 display 0000001234 (10 postions).

like image 298
Gerhard Weiss Avatar asked Mar 12 '09 15:03

Gerhard Weiss


People also ask

How do I get a zero in front of a number in Excel?

Use the "0"# format when you want to display one leading zero. When you use this format, the numbers that you type and the numbers that Microsoft Excel displays are listed in the following table. Example 2: Use the "000"# format when you want to display three leading zeros.


2 Answers

=TEXT(A1,"0000000000")

like image 127
NakedBrunch Avatar answered Oct 11 '22 10:10

NakedBrunch


Not a programming question, really:

  1. Select cells you want formatted in this way.
  2. Right click and select "Format Cells..."
  3. Select the "Number" Tag, and scroll down to "Custom" in the category list.
  4. Type "0000000000" into the Type field.
like image 34
mavnn Avatar answered Oct 11 '22 10:10

mavnn