IF/AND Formula

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??

Best Answers

  • Carson Penticuff
    Carson Penticuff ✭✭✭✭✭✭
    Answer ✓

    You were, indeed, very close.

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

  • SteyJ
    SteyJ ✭✭✭✭✭
    Answer ✓
    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:<\/p>

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

    How do I fix??<\/p>","bodyRaw":"[{\"insert\":\"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:\\n=IF([Invoice Received?]@row = 0, IF(AND([Renewal Date]@row >= TODAY(), [Renewal Date]@row <= TODAY(+30), \\\"Red\\\")))\\nHow do I fix??\\n\"}]","format":"rich","dateInserted":"2023-08-11T16:27:44+00:00","insertUser":{"userID":120231,"name":"Pamela Wagner","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Pamela%20Wagner","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-11T18:08:52+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"displayOptions":{"showUserLabel":false,"showCompactUserInfo":true,"showDiscussionLink":true,"showPostLink":true,"showCategoryLink":false,"renderFullContent":false,"expandByDefault":false},"url":"https:\/\/community.smartsheet.com\/discussion\/108861\/if-and-formula","embedType":"quote","name":"IF\/AND Formula"}"> https://community.smartsheet.com/discussion/108861/if-and-formula

    It looks like you forgot to close out theANDfuntion. 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!

    Jacob Stey

Answers

  • Carson Penticuff
    Carson Penticuff ✭✭✭✭✭✭
    Answer ✓

    You were, indeed, very close.

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

  • SteyJ
    SteyJ ✭✭✭✭✭
    Answer ✓
    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:<\/p>

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

    How do I fix??<\/p>","bodyRaw":"[{\"insert\":\"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:\\n=IF([Invoice Received?]@row = 0, IF(AND([Renewal Date]@row >= TODAY(), [Renewal Date]@row <= TODAY(+30), \\\"Red\\\")))\\nHow do I fix??\\n\"}]","format":"rich","dateInserted":"2023-08-11T16:27:44+00:00","insertUser":{"userID":120231,"name":"Pamela Wagner","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Pamela%20Wagner","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-11T18:08:52+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"displayOptions":{"showUserLabel":false,"showCompactUserInfo":true,"showDiscussionLink":true,"showPostLink":true,"showCategoryLink":false,"renderFullContent":false,"expandByDefault":false},"url":"https:\/\/community.smartsheet.com\/discussion\/108861\/if-and-formula","embedType":"quote","name":"IF\/AND Formula"}"> https://community.smartsheet.com/discussion/108861/if-and-formula

    It looks like you forgot to close out theANDfuntion. 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!

    Jacob Stey

  • Pamela Wagner
    Pamela Wagner ✭✭✭✭✭✭

    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.

  • Pamela Wagner
    Pamela Wagner ✭✭✭✭✭✭

    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公式手册模板!
= TODAY)) I appreciate any and all help on this!…","snippet":"Hi - Hoping to capture the sum of COLUMN A but only for dates (in the \"Date\" column) within the last 7 workdays. I am referencing another sheet. I am receiving the #UNPARSEABLE…","categoryID":322,"dateInserted":"2023-10-11T16:31:15+00:00","dateUpdated":null,"dateLastComment":"2023-10-11T17:11:20+00:00","insertUserID":151145,"insertUser":{"userID":151145,"name":"aecross","url":"https:\/\/community.smartsheet.com\/profile\/aecross","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-11T16:39:46+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-11T17:12:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":28,"score":null,"hot":3394087955,"url":"https:\/\/community.smartsheet.com\/discussion\/111524\/sumifs-formula-with-a-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111524\/sumifs-formula-with-a-date","format":"Rich","lastPost":{"discussionID":111524,"commentID":399554,"name":"Re: SUMIFS formula with a date","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/399554#Comment_399554","dateInserted":"2023-10-11T17:11:20+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-11T17:12:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-11T22:35:59+00:00","dateAnswered":"2023-10-11T16:38:52+00:00","acceptedAnswers":[{"commentID":399534,"body":"

Try this:<\/p>

=SUMIFS({Column A}, {Date}, AND(@cell>= WORKDAY(TODAY(), -7), @cell<= TODAY()))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":111509,"type":"question","name":"At Risk column symbol formatting based on status of another column help","excerpt":"I'm trying to have my At Risk column automatically assign a colored symbol based off selected status in a Status column. This is my current formula I built off other users post: =IF(Status@row = Not Started, \"Red\", IF(Status@row = In Progress, \"Yellow\", IF(Status@row = Complete, \"Green\"))) I'm getting the #UNPARSEABLE…","snippet":"I'm trying to have my At Risk column automatically assign a colored symbol based off selected status in a Status column. This is my current formula I built off other users post:…","categoryID":322,"dateInserted":"2023-10-11T13:56:15+00:00","dateUpdated":"2023-10-11T22:35:52+00:00","dateLastComment":"2023-10-11T17:10:49+00:00","insertUserID":168304,"insertUser":{"userID":168304,"name":"Brandon R","title":"New Store Operations","url":"https:\/\/community.smartsheet.com\/profile\/Brandon%20R","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-11T17:07:52+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":166028,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-11T17:12:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":53,"score":null,"hot":3394081024,"url":"https:\/\/community.smartsheet.com\/discussion\/111509\/at-risk-column-symbol-formatting-based-on-status-of-another-column-help","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111509\/at-risk-column-symbol-formatting-based-on-status-of-another-column-help","format":"Rich","lastPost":{"discussionID":111509,"commentID":399553,"name":"Re: At Risk column symbol formatting based on status of another column help","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/399553#Comment_399553","dateInserted":"2023-10-11T17:10:49+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-11T17:12:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/8EOWOYUDF1V2\/ss-at-risk-formula.jpg","urlSrcSet":{"10":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=10\/https:\/\/us.v-cdn.net\/6031209\/uploads\/8EOWOYUDF1V2\/ss-at-risk-formula.jpg","300":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=300\/https:\/\/us.v-cdn.net\/6031209\/uploads\/8EOWOYUDF1V2\/ss-at-risk-formula.jpg","800":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=800\/https:\/\/us.v-cdn.net\/6031209\/uploads\/8EOWOYUDF1V2\/ss-at-risk-formula.jpg","1200":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=1200\/https:\/\/us.v-cdn.net\/6031209\/uploads\/8EOWOYUDF1V2\/ss-at-risk-formula.jpg","1600":"https:\/\/us.v-cdn.net\/cdn-cgi\/image\/fit=scale-down,width=1600\/https:\/\/us.v-cdn.net\/6031209\/uploads\/8EOWOYUDF1V2\/ss-at-risk-formula.jpg"},"alt":"SS At Risk formula.jpg"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-11T14:04:45+00:00","dateAnswered":"2023-10-11T14:02:15+00:00","acceptedAnswers":[{"commentID":399483,"body":"

You need to put quotes around all text strings in formulas to include \"Not Started\", \"In Progress\", and \"Complete\".<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":111506,"type":"question","name":"How to add specific currency symbol?","excerpt":"Hello, I am trying to automate a smartsheet and I have done everything to this point, and have run into a problem. I have a PDF that needs to have money in it and it could be in any currency. so it could be $10,000 or ¥10,000, etc. But it doesn't fill the PDF with the money symbol and only the amount. It also doesn't add…","snippet":"Hello, I am trying to automate a smartsheet and I have done everything to this point, and have run into a problem. I have a PDF that needs to have money in it and it could be in…","categoryID":322,"dateInserted":"2023-10-11T13:03:47+00:00","dateUpdated":null,"dateLastComment":"2023-10-11T17:12:54+00:00","insertUserID":162036,"insertUser":{"userID":162036,"name":"Jeremy Y O","url":"https:\/\/community.smartsheet.com\/profile\/Jeremy%20Y%20O","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-11T17:11:20+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-11T17:12:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":28,"score":null,"hot":3394078001,"url":"https:\/\/community.smartsheet.com\/discussion\/111506\/how-to-add-specific-currency-symbol","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111506\/how-to-add-specific-currency-symbol","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":111506,"commentID":399558,"name":"Re: How to add specific currency symbol?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/399558#Comment_399558","dateInserted":"2023-10-11T17:12:54+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-11T17:12:14+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-11T22:36:45+00:00","dateAnswered":"2023-10-11T16:15:31+00:00","acceptedAnswers":[{"commentID":399520,"body":"

You have two options. You can use a nested IF statement to output, or (since it seems like you need quite a few), you can create a table that has the text in one column and the symbol in another column and use an INDEX\/MATCH.<\/p>


<\/p>

Here is a list of the UNICHAR currency symbols (it may be easier if you are able to type them or copy\/paste from somewhere - whichever you prefer):<\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n
\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n


<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Formulas and Functions