Month from Date column

Options

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 Admin
    Answer ✓
    Options

    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

Answers

  • Genevieve P.
    Genevieve P. Employee Admin
    Answer ✓
    Options

    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

  • chrishallo
    Options

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

  • Genevieve P.
    Genevieve P. Employee Admin
    Options

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

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!