Recording Numbers beginning with 0

Excel_77

Active Member
Joined
Sep 15, 2016
Messages
306
Office Version
  1. 2019
Platform
  1. Windows
I have a list of 1000 IDs, each ID must be 10 digits long and must be saved as a number. At the moment those which should have 0's at the front are appearing with the 0's dropped, this means that my vloopup on this ID is not working. Is there an easy solution? I know I can save them as text, however, again when I do this the vlooup cannot find the ID.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Format your column as Text and maybe use the TEXT function to lookup your value. Hard to say without example
 
Upvote 0
You can format the cell to appear as 10 digits with a custom format of 0000000000 but the leading zero's will not be stored in the cell with anything other than text.
 
Upvote 0
Excel_77, Good afternoon.

You can make it work in a easy way.

To make trailing zeros appear, use formatting cells in the range.
Select column of IDs, Format cells, Custom, Numbers and ENTER ten(10) zeros in the field.
So all zeros of the IDs will appear in a number way.

Now just use the VLOOKUP function normally.

The lack of zeros appearing in the cell does not make VLOOKUP stop working. Must be another reason.

Please, tell us if this is what you wanted.
I hope I've helped.
 
Upvote 0
Ok here is an example:

123456789 is appearing on the main file, in the source file it is 0123456789. Is it possible that the vlookup can match the two numbers as being the same?
 
Upvote 0
Repeating what I already said above, or at least part of it
the leading zero's will not be stored in the cell with anything other than text.
If both cells are formatted as valid numbers then they will match.
 
Upvote 0
Excel_77,

What is the format of number on the MAIN FILE?

What is the format of number on the SOURCE FILE?

This will define how the search with VLOOKUP should be done.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top