The TEXT function can apply number formats of any kind, including currency, date, percentage, etc. By applying a number format like "00", "000", "0000", you can "pad" numbers with as many zeros as you like. Zeros will only be added where needed.
Number format only
The TEXT function converts numbers to text as a normal step in applying the number format.
If you are concatenating (joining) the result to another text string, this is fine, but if you just want to apply visual padding to a free-standing number set of numbers, you can apply a custom number format without using a formula.
To get the week number from the day from a date, you can use the WEEKNUM function . In the example shown, the formula in C5, copied down, is: = WEEKNUM ( B5 ) With the date January 5, 2016 in B5, WEEKNUM returns 2 as the the week number. Note: The...
The Excel WEEKNUM function takes a date and returns a week number (1-54) that corresponds to the week of year. The WEEKNUM function starts counting with the week that contains January 1. By default, weeks begin on Sunday.
Excel Formula Training
Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.