Let’s take a look. First, let’s look at the problem. Here’s a list of numbers that need to be formatted as shown in column C. When we try to enter the values directly, we can see that Excel just strips off the leading zeros. In the case of the part code, Excel actually interprets the code as a date. The problem is that Excel is treating these values as numbers or dates. We need a way to tell Excel to treat this input as text. There are two ways we can do this. The first way is to use a single apostrophe when entering the values. This tells Excel to treat the content as text. Note that we can see the apostrophe in the formula bar when the cells are selected. However, the apostrophe is not visible in the worksheet. The second way is to format cells as text before inputting values. This will cause Excel to treat all input to these cells as text. Note that with this technique, the formula bar does not show an apostrophe. With both of these approaches, you might see Excel flag the value as an error with a “Number stored as text” message. You can easily tell Excel to ignore this error.  

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.