Format Formula Results with Leading Zeros

NSG185

New Member
Joined
Nov 4, 2010
Messages
3
I have a lookup formula that is returning values to include in a part number. The value that comes up might be "2103" or "5242698" but I need them all to be formatted with 8 digits so I want the appropriate amnt. of 0s to be added.

i.e.
Formula Value / Required Format
2103 = 00002103
5242698 = 05242698

Thanks for your help.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
If you want them to be text values then do;
=TEXT(lookup_formula,"00000000")
 
Upvote 0
Hi

You didn't mention what your lookup formula was, but assuming it is a vlookup, just wrap it in the TEXT() function:

=TEXT(YourLookupFormula,"00000000")
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,930
Members
452,367
Latest member
TePunaBloke

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