Month from Date column

Good afternoon! I think I may be overcomplicating this. With the below, I'm trying to pull the month based on A. However, as it was a drop-down for the purposes of the form, I copied it as a date column in B.

I included a legend of what is what and what I'm trying to get is the formula for D through F to work. What am I doing wrong?


Best Answer

  • Genevieve P.
    Genevieve P. Employee
    Answer ✓

    Hi @chrishallo

    Since you're using a Dropdown type of column, the data in the dropdown cell is seen as text versus a date. Then when you bring it into the Date column with =[Week as of Monday]@row , it's actually still seen as text. Unless you restrict the Date column to dates, you can type text in cells.

    The MONTH function can only work on a date type of cell, which is why you're getting an error.

    Is there a specific reason you want to have the column type be Dropdown and not date? If it was a Date column you could skip all of your helpers and just use =MONTH([Week as of Monday]@row) to bring back the month number.

    If it has to be a dropdown selection, I would advise standardizing the way your Days and Months are displayed in the text. Always have DD/MM/YY.

    Then we can use the MID function to grab the month number out of the middle of the text, like so:

    =MID([Week as of Monday]@row, 4, 2)

    Will this work for you?

    Cheers,

    Genevieve

    Need more information? 👀 | Help and Learning Center

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

Answers

  • Genevieve P.
    Genevieve P. Employee
    Answer ✓

    Hi @chrishallo

    Since you're using a Dropdown type of column, the data in the dropdown cell is seen as text versus a date. Then when you bring it into the Date column with =[Week as of Monday]@row , it's actually still seen as text. Unless you restrict the Date column to dates, you can type text in cells.

    The MONTH function can only work on a date type of cell, which is why you're getting an error.

    Is there a specific reason you want to have the column type be Dropdown and not date? If it was a Date column you could skip all of your helpers and just use =MONTH([Week as of Monday]@row) to bring back the month number.

    If it has to be a dropdown selection, I would advise standardizing the way your Days and Months are displayed in the text. Always have DD/MM/YY.

    Then we can use the MID function to grab the month number out of the middle of the text, like so:

    =MID([Week as of Monday]@row, 4, 2)

    Will this work for you?

    Cheers,

    Genevieve

    Need more information? 👀 | Help and Learning Center

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

  • Hello, Genevieve and thank you. I changed my logic so things are good now. I appreciate the feedback!

  • No problem! I'm glad you were able to find a solution.

    Need more information? 👀 | Help and Learning Center

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

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!