Want to create more than one IF statement

Hi! I don't know whats wrong with this formula, it's giving "Incorrect argument".

=IF(OR(Month@row = "10"; Month@row = "11"; Month@row = "12"); IF(AND([Return date]@row = YEAR(TODAY()); "Q4")))

I want to say: If month equals to 10, 11 or 12 (I created a month column), and if the year equals to the year today, then put Q1 on the cell. This is actually trying to separate the year in quarters, so I'll have to do this for every month of the year, months 1,2,3 = Q1; 4,5,6 = Q2; 7,8,9 = Q3.

Answers

  • Don Young
    Don Young ✭✭✭✭
    edited 03/14/23

    Try separating each argument within OR() and AND() with a comma instead of a semicolon. The same for each argument within the IF().

  • Nick Korna
    Nick Korna ✭✭✭✭✭✭

    Hi @browning.m,

    The incorrect argument is caused by how your formula is composed, so this should assist!

    You can skip the Month column if you are taking the month from the return date:

    =IF(AND(OR(MONTH([Return Date]@row) = 1, MONTH([Return Date]@row) = 2, MONTH([Return Date]@row) = 3), YEAR([Return Date]@row) = YEAR(TODAY())), "Q1", IF(AND(OR(MONTH([Return Date]@row) = 4, MONTH([Return Date]@row) = 5, MONTH([Return Date]@row) = 6), YEAR([Return Date]@row) = YEAR(TODAY())), "Q2", IF(AND(OR(MONTH([Return Date]@row) = 7, MONTH([Return Date]@row) = 8, MONTH([Return Date]@row) = 9), YEAR([Return Date]@row) = YEAR(TODAY())), "Q3", IF(AND(OR(MONTH([Return Date]@row) = 10, MONTH([Return Date]@row) = 11, MONTH([Return Date]@row) = 12), YEAR([Return Date]@row) = YEAR(TODAY())), "Q4"))))

    This would give you the following result:

    You've not specified what you'd like to happen to dates falling outside of this year, so I haven't been able to include that in the formula. If you have something in particular I can hopefully help with that.

    Hopefully this helps, if you've any questions etc. then just post! 😊

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!