Text to Date Field

Hi,

I've been looking at the community board for a formula to convert a text date (ie. 05/21/21) to a DATE type data entry in a new column. Any suggestions?

Thanks,

John

Best Answer

  • Genevieve P.
    Genevieve P. Employee
    Answer ✓

    Hi @John Stanik

    Will your text entry always have the exact same format of mm/dd/yy?

    You can use the DATE function to translate numbers into Dates, with the syntax being DATE(YYYY, MM, DD).

    In this instance, we'll want to use the VALUE Function around each number set we're grabbing, like so:

    DATE(VALUE(20 + YY), VALUE(MM), VALUE(DD))

    Then we can use the RIGHT Function, MID Function, and LEFT Function to grab different elements of your text string.

    DATE(VALUE(20 + RIGHT(YY)), VALUE(LEFT(MM)), VALUE(MID(DD)))

    For the MID portion, we'll need to use a FIND Function to find the starting position (a number) of whatever it is looking for, in this case a "/". The formula uses the number it finds as a starting position in the text string.

    Full Formula:

    =DATE(VALUE(20 + RIGHT([Text Column]@row, 2)), VALUE(LEFT([Text Column]@row, 2)), VALUE(MID([Text Column]@row, FIND("/", [Text Column]@row) + 1, 2)))


    You'll need to enter the formula into a Date Column. Let me know if this works and makes sense!

    Cheers,

    Genevieve

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!