Formula to add leading zero to months 1-9 of the year only.

Options
Reinierh
Reinierh ✭✭
edited 11/25/23 in Formulas and Functions

I need to add leading zeros to month numbers Jan-Sept only as sorting by month number does not work due to Months Oct-Dec starting with number 1. If I sort by month number, it comes up like this.

1 (Jan), 10 (Oct), 11 (Nov), 12 (Dec), 2 (Feb), 3(March) ...

Does anyone have a formula for this?

Best Answer

  • John_Foster
    John_Foster ✭✭✭✭✭✭
    Answer ✓
    Options

    If the month field is a text value try adding a zero in front of the value and then taking the right two digits using the formula below.

    =RIGHT("0" + {YOUR_MONTH_VALUE_HERE}, 2)

    Hope it helps!

    John

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!