Removing with Leading Zeros

Hello Smartsheet Community!!

We are having a bit of a struggle with leading zeros and trying to strip them out of our project numbers.

When we use this formula, it removed all zeros in the project numbers. For the project numbers that do not have any zeros other than the leading zero, it still allows us to do an index match.

VALUE(SUBSTITUTE(Number@row, 0, ""))

When we use this formula, it gives us the results we are looking for (just removing the leading zero), but our index matches no longer work.

IF(LEFT(Number@row, 1) = "0", RIGHT(Number@row, LEN(Number@row) - 1), Number@row)

Any suggestions are greatly appreciated. Thank you! 😊

Best Answer

  • Kelly Moore
    Kelly Moore ✭✭✭✭✭✭
    Answer ✓

    Hey @Nancy Heater

    The VALUE function should do the trick for you. (By the way, did you try just using the VALUE() function without the SUBSTITUTE() to your first formula? =VALUE(Number@row)

    When using the LEFT, RIGHT, MID, SUBSTITUTE etc, the values become textstrings. Try this

    IF(LEFT(Number@row, 1) = "0", VALUE(RIGHT(Number@row, LEN(Number@row) - 1)), Number@row)

    Will this work for you?



Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!