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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,215,767
Messages
6,126,775
Members
449,336
Latest member
p17tootie

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