Hi @Louise Wooding
Welcome to the Q&A Community
I’m here to assist with your problem.
To retain leading zeros when entering numbers of varying lengths in Excel (while storing them as text for VLOOKUP compatibility, without using an apostrophe), follow these steps:
- Select the cell(s) or range where you'll enter the data.
- Right-click and choose Format Cells (or press Ctrl+1 on Windows / Cmd+1 on Mac).
- In the Format Cells dialog, go to the Number tab.
- Under Category, select Text.
- Click OK.


Now, when you enter a value like 00123 into those cells, Excel will treat it as text and preserve the leading zeros exactly as typed. This works for any length, as it's not applying a fixed numeric format.
- For VLOOKUP: Ensure the lookup value and the table array column are both formatted as text for consistent matching. If needed, you can convert existing numeric data to text using the TEXT function (e.g., =TEXT(A1, "0")) or by selecting the range, going to Data > Text to Columns > Delimited > Next > Next > Text (under Column data format) > Finish.
- Noted: Once stored as text, arithmetic operations won't work directly on these values (e.g., summing them), but you can convert temporarily with VALUE() if needed (e.g., =VALUE(A1) + 10).

We appreciate your kind patience and understanding that sometimes the initial response may not immediately resolve the issue or there may be some misunderstandings about your scenario, but we would love to hear updates from you and find out further suggestions.
Thank you for your kindness and understanding. If you need anything else, please feel free to contact me.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment"
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
