IF Contains Nested Formula Error
Hello!
Would anybody be able to see what I'm doing wrong here? I'm trying to make it so if my "Part Number" column contains "Purchase Order" that the green icon doesn't show up.
Here's my formula:
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF([email protected]= "", "", IF(CONTAINS("Purchase Order", [Part Number]:[Part Number]), "")))))))))))))
I'm just trying to make the formatting look nicer. Also if I filter for the green circle in a report I don't want to see those rows.
Best Answer
-
Paul Newcome ✭✭✭✭✭✭
@AnnieRNot quite. Each CONTAINS function should be closed independently. This means that one of your bold closing parenthesis should be moved to close out the "Credit Card" CONTAINS.
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF(OR(CONTAINS("Purchase Order", [Part Number]@row), CONTAINS("Credit Card", [Part Number]@row),CONTAINS("Stock Items", [Part Number]@row)),"", IF([email protected]= "", ""))))))))))))
Think of it this way:
OR(argument1, argument2, argument3)
CONTAINS("A",[email protected])
CONTAINS("B",[email protected])
CONTAINS("C",[email protected])
You would then drop each of the CONTAINS functions into an "argument" section of the OR function like so:
OR(CONTAINS("A",[email protected]), CONTAINS("B",[email protected]), CONTAINS("C",[email protected]))
thinkspi.com
Answers
-
Paul Newcome ✭✭✭✭✭✭
Try changing it from a column reference
[Part Number]:[Part Number]
to a cell reference the same way you referenced your Status
[Part Number]@row
thinkspi.com
-
AnnieR ✭
Thank you@Paul Newcome! Unfortunately that didn't work.
-
Paul Newcome ✭✭✭✭✭✭
你能提供确切的(新)公式吗well as a screenshot of a row containing "Purchase Order" in the [Part Number] column?
thinkspi.com
-
AnnieR ✭
Yes! :)
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF([email protected]= "", "", IF(CONTAINS("Purchase Order", [Part Number]@row), "")))))))))))))
-
Paul Newcome ✭✭✭✭✭✭
Oh. Your argument immediately before is to output the Green Ball if the Status cell is empty. Try switching those two around so the IF(CONTAINS(.....), "", portion comes before the Status is blank portion.
thinkspi.com
-
AnnieR ✭
Darnit sorry@Paul NewcomeI don't know how I'm mixing this up. I also need to add in to be blank if "Credit Card" is in the Part Number column but I can't even get this to work.
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF(CONTAINS("Purchase Order", [Part Number]@row), " "), IF([email protected]= "", ""))))))))))))
Now I'm just getting an Incorrect Arguement Error.
-
Paul Newcome ✭✭✭✭✭✭
The error message is coming from a misplaced closing parenthesis before the final IF. Here it is removed.
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF(CONTAINS("Purchase Order", [Part Number]@row), "", IF([email protected]= "", ""))))))))))))
To factor in the "Credit Card" bit, we would add an OR statement to the blank output like so:
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF(OR(CONTAINS("Purchase Order", [Part Number]@row), CONTAINS("Credit Card", [Part Number]@row)), "", IF([email protected]= "", ""))))))))))))
thinkspi.com
-
AnnieR ✭
@Paul NewcomeThank you!!!! That worked! The only weird thing was it didn't work if I just copy pasted it in. I had to hand key it back in, which I thought was pretty odd. It was giving me a syntax error if I just copy pasted.
If I wanted to add in a few more items for the "Purchase Order" or "Credit Card" bits. Like "Stock Items" would this be right?
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF(OR(CONTAINS("Purchase Order", [Part Number]@row), CONTAINS("Credit Card", [Part Number]@row, CONTAINS("Stock Items", [Part Number]@row))), "", IF([email protected]= "", ""))))))))))))
-
Paul Newcome ✭✭✭✭✭✭
@AnnieRNot quite. Each CONTAINS function should be closed independently. This means that one of your bold closing parenthesis should be moved to close out the "Credit Card" CONTAINS.
=IF([email protected]= "RFQ", "", IF([email protected]= "Ordered", "", IF([email protected]= "Received", "☑️", IF([email protected]= "Partial", "", IF([email protected]= "Stock", "☑️", IF([email protected]= "Ready at Vendor", "⏺️", IF([email protected]= "@ S.O. Vendor", "", IF([email protected]= "Hold", "", IF([email protected]= "Cancelled", "", IF([email protected]= "Order Confirmed", "", IF([email protected]= "Reference Only", "", IF(OR(CONTAINS("Purchase Order", [Part Number]@row), CONTAINS("Credit Card", [Part Number]@row),CONTAINS("Stock Items", [Part Number]@row)),"", IF([email protected]= "", ""))))))))))))
Think of it this way:
OR(argument1, argument2, argument3)
CONTAINS("A",[email protected])
CONTAINS("B",[email protected])
CONTAINS("C",[email protected])
You would then drop each of the CONTAINS functions into an "argument" section of the OR function like so:
OR(CONTAINS("A",[email protected]), CONTAINS("B",[email protected]), CONTAINS("C",[email protected]))
thinkspi.com
-
AnnieR ✭
I'm sorry for my late reply@Paul Newcome!! This worked perfectly!! Thank you for teaching me too. I really appreciate it. Happy Friday and hope you have a good weekend :)
-
Paul Newcome ✭✭✭✭✭✭
Help Article Resources
Categories
=IF(AND(type@row=\"project\", status@row=\"in progress\", [target completion date]@row < TODAY()), 1, 0)<\/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":107853,"type":"question","name":"Need help with a date formula to always return a Friday date.","excerpt":"I see there is a standard formula and you just need to change the last number depending on the day of the week. Date@row - WEEKDAY(Date@row) + 2 The \"+ 2\" can be modified to pick a different day of the week. 1 = Sunday, 3 = Tuesday, etc. Here is the formula on my sheet but is shows #unparseable. =Customer Date Needed@row -…","snippet":"I see there is a standard formula and you just need to change the last number depending on the day of the week. Date@row - WEEKDAY(Date@row) + 2 The \"+ 2\" can be modified to pick…","categoryID":322,"dateInserted":"2023-07-20T13:20:08+00:00","dateUpdated":null,"dateLastComment":"2023-07-20T18:36:28+00:00","insertUserID":163628,"insertUser":{"userID":163628,"name":"Jose G.","title":"Planner","url":"https:\/\/community.smartsheet.com\/profile\/Jose%20G.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-07-20T18:39:21+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":147819,"lastUser":{"userID":147819,"name":"MichaelTCA","url":"https:\/\/community.smartsheet.com\/profile\/MichaelTCA","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!naloP9MDFDs!u7kqZ3eepDs!ZlXWVSCN_A6","dateLastActive":"2023-07-20T18:34:07+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":48,"score":null,"hot":3379741596,"url":"https:\/\/community.smartsheet.com\/discussion\/107853\/need-help-with-a-date-formula-to-always-return-a-friday-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107853\/need-help-with-a-date-formula-to-always-return-a-friday-date","format":"Rich","lastPost":{"discussionID":107853,"commentID":386244,"name":"Re: Need help with a date formula to always return a Friday date.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/386244#Comment_386244","dateInserted":"2023-07-20T18:36:28+00:00","insertUserID":147819,"insertUser":{"userID":147819,"name":"MichaelTCA","url":"https:\/\/community.smartsheet.com\/profile\/MichaelTCA","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!naloP9MDFDs!u7kqZ3eepDs!ZlXWVSCN_A6","dateLastActive":"2023-07-20T18:34:07+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-07-20T17:56:13+00:00","dateAnswered":"2023-07-20T13:28:45+00:00","acceptedAnswers":[{"commentID":386145,"body":"
If your column name contains spaces, you will need to enclose it in square brackets.<\/p>
=[Customer Date Needed]@row - WEEKDAY([Customer Dated Needed]@row) + 6<\/p>"},{"commentID":386152,"body":"
Column names containing a space, number, and\/or special character need to be wrapped in [square brackets]<\/strong> when referenced in a formula.<\/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":107860,"type":"question","name":"Need help with a formula","excerpt":"Hi, I feel like this one should be so easy, but it's just not working for me. So basically if Column A = Column B, I need a box to be checked in column C I was doing: =IF([Today]@row) = ([Eval Due Date]@row(), 1, 0) but getting #UNPARSEABLE Thanks in advance for any help!","snippet":"Hi, I feel like this one should be so easy, but it's just not working for me. So basically if Column A = Column B, I need a box to be checked in column C I was doing:…","categoryID":322,"dateInserted":"2023-07-20T15:46:23+00:00","dateUpdated":null,"dateLastComment":"2023-07-20T15:56:34+00:00","insertUserID":150109,"insertUser":{"userID":150109,"name":"TracyM","url":"https:\/\/community.smartsheet.com\/profile\/TracyM","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!wSVWcAGv0AQ!Bh_XAXmyNvw!JcMVrvjssK-","dateLastActive":"2023-07-20T16:05:38+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-07-20T18:21:40+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":17,"score":null,"hot":3379737177,"url":"https:\/\/community.smartsheet.com\/discussion\/107860\/need-help-with-a-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107860\/need-help-with-a-formula","format":"Rich","lastPost":{"discussionID":107860,"commentID":386186,"name":"Re: Need help with a formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/386186#Comment_386186","dateInserted":"2023-07-20T15:56:34+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-07-20T18:21:40+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-07-20T16:05:36+00:00","dateAnswered":"2023-07-20T15:56:34+00:00","acceptedAnswers":[{"commentID":386186,"body":" You've just got some parenthesis that need removed. Try this:<\/p> =IF(Today@row = [Eval Due Date]@row, 1, 0)<\/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":[]}],"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":[]}">