using AND
Hi,
Beginning 2023 I found my formula to say 'Yes" in a column if the row was entered this month was doing it for the previous years month as well so not delivering a true result for entries of the "Current month".
Old formula.
=IF(MONTH([Customer reported date]@row) = MONTH(TODAY(0)), "YES", "NO")
I also have a formula doing the same for if the entry was this year
=IF(YEAR([Customer reported date]@row) = YEAR(TODAY(0)), "YES", "NO")
To replace the first formula I was trying to combine the two but keep getting an incomplete error?
Was trying the below, what am I getting wrong?
=IF(AND(MONTH([Customer reported date]@row) = MONTH(TODAY(0))),(YEAR([Customer reported date]@row) = YEAR(TODAY(0))), "YES", "NO")
Thank you in advance for any help.
Best Answers
-
You were very close! It's just where you had your parentheses.
Try this: =IF(AND(MONTH([Customer reported date]@row) = MONTH(TODAY(0)), (YEAR([Customer reported date]@row) = YEAR(TODAY(0)))), "YES", "NO")
I moved one parenthesis as shown in bold above. That parenthesis closed out the AND formula, which we didn't want to do until we'd included the YEAR condition.
www.linkedin.com/in/juliefortney-pmp-smartsheetpartner-lssblackbelt
-
Try =IF(AND(MONTH([Customer reported date]@row) = MONTH(TODAY()), (YEAR([Customer reported date]@row) = YEAR(TODAY()))), "YES", "NO")
Answers
-
You were very close! It's just where you had your parentheses.
Try this: =IF(AND(MONTH([Customer reported date]@row) = MONTH(TODAY(0)), (YEAR([Customer reported date]@row) = YEAR(TODAY(0)))), "YES", "NO")
I moved one parenthesis as shown in bold above. That parenthesis closed out the AND formula, which we didn't want to do until we'd included the YEAR condition.
www.linkedin.com/in/juliefortney-pmp-smartsheetpartner-lssblackbelt
-
Try =IF(AND(MONTH([Customer reported date]@row) = MONTH(TODAY()), (YEAR([Customer reported date]@row) = YEAR(TODAY()))), "YES", "NO")
-
Thank you, I can see just how close it was! Working nicely now!
Help Article Resources
Categories
Check out the Formula Handbook template!