# IF/AND Formula

Options
✭✭✭✭✭✭

Formulas are the bane of my existence and I really need to take a class! Today I'm trying to set up a formula to throw a flag when 2 conditions are met. I want a red ball when I have not received an invoice and the invoice due date is within 30 days. I know I'm close since I've gone from "unparsable" to "incorrect argument"! Here is what I have:

=IF([Invoice Received?]@row = 0, IF(AND([Renewal Date]@row >= TODAY(), [Renewal Date]@row <= TODAY(+30), "Red")))

How do I fix??

• ✭✭✭✭✭✭
Options

You were, indeed, very close.

=IF([Invoice Received?]@row = 0, IF(AND([Renewal Date]@row >= TODAY(), [Renewal Date]@row <= TODAY(+30)), "Red"))

• ✭✭✭✭✭✭
Options

It looks like you forgot to close out the AND funtion. Try this

=IF([Invoice Received?]@row = 0, "Green", IF(AND([Renewal Date]@row >= TODAY(0), [Renewal Date]@row <= TODAY(+30)), "Red", "Yellow"))

Hope this helps!

##### Sincerely,

Jacob Stey

• ✭✭✭✭✭✭
Options

You were, indeed, very close.

=IF([Invoice Received?]@row = 0, IF(AND([Renewal Date]@row >= TODAY(), [Renewal Date]@row <= TODAY(+30)), "Red"))

• ✭✭✭✭✭✭
Options

It looks like you forgot to close out the AND funtion. Try this

=IF([Invoice Received?]@row = 0, "Green", IF(AND([Renewal Date]@row >= TODAY(0), [Renewal Date]@row <= TODAY(+30)), "Red", "Yellow"))

Hope this helps!

##### Sincerely,

Jacob Stey

• ✭✭✭✭✭✭
Options

Thanks @SteyJ ! I made one tweak:

=IF([Invoice Received?]@row = 0, IF(AND([Renewal Date]@row >= TODAY(0), [Renewal Date]@row <= TODAY(+30)), "Red", "Yellow"))

I don't need the Green dot that you put at the beginning but I do see what you did. I didn't put in the alternate, if this meets the condition do X/if it doesn't meet the condition do Y. I missed the 'doesn't meet condition' part.

• ✭✭✭✭✭✭
Options

Thanks also @Carson Penticuff ! Your formula works as well and now I need to determine the difference! Always good to have options!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!