For starters, let's see how you can put 0 in front of a number in Excel, for example, type 02 in a cell. For this, simply change the cell format to Text:
- Select the cell(s) where you want to prefix numbers with 0.
- Go to the Home tab > Number group, and select Text in the Number Format box.
As soon as you type a zero(s) before the number, Excel will display a small green triangle in the top-left corner of the cell indicating that something is wrong with the cell contents. To remove that triangle, select the cell(s), click the warning sign, and then click Ignore Error.
The following screenshot shows the result:
Another way to keep leading zeros in Excel is to prefix a number with an apostrophe ('). For example, instead of typing 01, type '01. In this case, you don't need to change the cell's format.