What you will build
Complete “Fix leading zeros disappearing” using the visible Raw code, Safe text code sample so each action and the final state can be checked against the source data.
Learning objectives
Open the practice workbook
Practice in your own copy
Make your own Google Sheets copy with the same data, formulas, formatting, filter and frozen header. The original remains unchanged.
Sign in to Google. If the original is not publicly shared, download the full workbook and import it into Google Sheets, or paste the example data into your own sheet.
Hands-on practice
Step 1: Select A2, enter 00123, and press Enter. Confirm that the cell displays 123 — this reproduces the leading-zero problem.
Step 2: For identifiers, prefix the entry with an apostrophe: type '00123 in B2 and '00045 in B3. After you press Enter, the apostrophe is not displayed in the cell, but it makes Sheets store the code as text.
Step 3: Confirm that B2 displays 00123 and B3 displays 00045 while A2:A3 remain 123 and 45 for comparison.
Checkpoint
| Raw code | Safe text code |
|---|---|
| 123 | 00123 |
| 45 | 00045 |
Checkpoint: keep A2:A3 as the numeric comparison values; B2:B3 must display exactly 00123 and 00045 as text identifiers.
Common mistakes and fixes
Correction: re-enter the identifier with a leading apostrophe, for example '00123. If the earlier entry already became 123, Sheets cannot reconstruct the lost zeros automatically.
Independent practice
Add one row with the same schema, repeat the action, verify the new row behaves correctly, then remove it to restore the sample.
Key takeaways
- ✓Google Sheets can remove leading zeros when an identifier is interpreted as a number.
- ✓For identifiers, prefix the entry with an apostrophe so the value is stored as text.
- ✓The leading apostrophe used to force text storage is not displayed in the cell after Enter.
- ✓The correct checkpoint keeps B2 = 00123 and B3 = 00045 while A2:A3 are 123 and 45 for comparison.
- ✓Do not use this text technique for values that need numeric calculations.
Check your understanding
Answer four questions about the practice sheet.
Next lesson
Continue in recommended learning order with Fix decimal and currency locale issues.
Comments
No comments yet. Be the first to join the discussion.