Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.

COUNTIF USING OR

How do I add an OR to the expression and logic:

="Resource: " + COUNTIF(CHILDREN(Status1:Status17), "Terminal Updated") + " of " + COUNT(CHILDREN(Status1:Status17))

I want to add both Terminal Updated and Terminal Replacement to the count.

Any help greatly appreciated!

Tags:

Comments

  • Hi Tee,

    If you're looking to have your COUNTIF count anything that meets one of multiple criteria, then you can use a formula like the following example:

    =COUNTIF(CHILDREN([Status1:Status17), OR(@cell= "Terminal Updated",@cell= "Terminal Replacement"))

    You'll want to replace your current COUNTIF with this.

    One other note on the CHILDREN() function is that if your formula is in the parent and it's referencing its direct children (cells right underneath it) you don't need to add cell references, e.g. =COUNTIF(CHILDREN(), OR(@cell= "Terminal Updated",@cell= "Terminal Replacement"))

    If you want the formula to reference another parent's children, you can just reference the parent cell, e.g. = COUNTIF(CHILDREN(Status1), OR(@cell= "Terminal Updated",@cell= "Terminal Replacement"))

  • Thanks, I will try it

  • This does not actually work for me.

    I've published an example here if I can get some support getting it working. Screenshots attached. Error is #Invalid Operation.

    https://app.smartsheet.com/b/publish?EQBCT=491449d252c04838be1208fe5cd9c5f8

    Josh

    Screenshot_2018-04-18_17-16-25.png

    screenshot_2018 - 04 - 18 - _17 - 16 - 38. png

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Responding to Josh:

    Your syntax is wrong. Your use of the [Type] column implies you are looking for something there (car, wagon, etc...) but you aren't.

    I fixed the formula on your sheet:

    =COUNTIF(Color1:Color11, OR(@cell= "Red",@cell= "Yellow"))

    If you are wanting to use TYPE, use COUNTIFS

    I hope this helps

    Craig

  • And that's why J. Craig is the man.

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    You are welcome.

    Craig

  • diegoartorres
    diegoartorres ✭✭
    edited 10/18/18

    Hello everyone,

    I am looking to have an information sheet that is looking for several criteria with "and" and "or".

    For example, I want the formula to count if the other sheet has "Priority 1" and "John Doe" and a status of either 1 or 2 or 3.

    I will have another cell on the information sheet for "Priority 2" and "John Doe" and a status of either 1 or 2 or 3.

    I am not using children and the sheet I am referencing is one that I am shared with as Editor - cannot share, in case that is an issue.

    Thank you.

    Sincerely,

    Diego

This discussion has been closed.
Hi, <\/p>

Instead of applying the formula to \"Multiselect Text String\" row, did you tried with \"Multiselect Values\" row?<\/p>

=IF(HAS([Multiselect Values]@row, [Component ID]@row), \"MATCH\", \"NO MATCH\")<\/p>

Thank you,<\/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":109493,"type":"question","name":"I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","excerpt":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5 different statuses in a separate column. So using the screenshot I've provided as an example (although it doesn't have 5 different statuses in the…","snippet":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5…","categoryID":322,"dateInserted":"2023-08-25T20:03:21+00:00","dateUpdated":null,"dateLastComment":"2023-08-26T00:34:49+00:00","insertUserID":165710,"insertUser":{"userID":165710,"name":"SmarsheetNewb","url":"https:\/\/community.smartsheet.com\/profile\/SmarsheetNewb","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-26T00:33:27+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161714,"lastUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-27T02:16:35+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":26,"score":null,"hot":3386005690,"url":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109493,"commentID":392692,"name":"Re: I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392692#Comment_392692","dateInserted":"2023-08-26T00:34:49+00:00","insertUserID":161714,"insertUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-27T02:16:35+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-08-26T00:33:25+00:00","dateAnswered":"2023-08-25T20:44:12+00:00","acceptedAnswers":[{"commentID":392662,"body":"

Try this:<\/p>

=COUNTIFS([Item Number]:[Item Number], OR(@cell = \"C001\", @cell = \"COO2\", @cell = \"COO3\", @cell = \"COO4\"), [Status]:[Status], OR(@cell = \"Green\", @cell = \"Yellow\", @cell = \"Red\"))<\/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"}]},{"discussionID":109500,"type":"question","name":"Auto-populate emails on a \"contact list\" column","excerpt":"I have a Form created for internal employees where they can submit request tickets to my department. We all have an account with Smartsheet. One of our columns (\"Requestor Name\") is in the Form where they type in their names. The \"Requestor Name\" column is a Contac List column. My issue here is, how can I have Smartsheet…","snippet":"I have a Form created for internal employees where they can submit request tickets to my department. We all have an account with Smartsheet. One of our columns (\"Requestor Name\")…","categoryID":321,"dateInserted":"2023-08-25T21:43:36+00:00","dateUpdated":"2023-08-25T21:44:14+00:00","dateLastComment":"2023-08-25T22:14:15+00:00","insertUserID":164850,"insertUser":{"userID":164850,"name":"ocanel","title":"Analyst","url":"https:\/\/community.smartsheet.com\/profile\/ocanel","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-27T06:55:05+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":164850,"lastUserID":165374,"lastUser":{"userID":165374,"name":"Shanky Paul","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Shanky%20Paul","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/AAcHTtcAdE60g-MBEj1rR28GVz9zn6RmbZsmEQm5EiEV=s96-c","dateLastActive":"2023-08-27T08:29:18+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":25,"score":null,"hot":3386002071,"url":"https:\/\/community.smartsheet.com\/discussion\/109500\/auto-populate-emails-on-a-contact-list-column","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109500\/auto-populate-emails-on-a-contact-list-column","format":"Rich","tagIDs":[204,247,334,448,527],"lastPost":{"discussionID":109500,"commentID":392677,"name":"Re: Auto-populate emails on a \"contact list\" column","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392677#Comment_392677","dateInserted":"2023-08-25T22:14:15+00:00","insertUserID":165374,"insertUser":{"userID":165374,"name":"Shanky Paul","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Shanky%20Paul","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/AAcHTtcAdE60g-MBEj1rR28GVz9zn6RmbZsmEQm5EiEV=s96-c","dateLastActive":"2023-08-27T08:29:18+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":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-27T06:55:03+00:00","dateAnswered":"2023-08-25T22:14:15+00:00","acceptedAnswers":[{"commentID":392677,"body":"

Hi, <\/p>

Add a \"Created By\" column in your sheet and turn on \"Required smartsheet login to access your form\" in your form setting. So that whoever fills out the form, their email id will be automatically captured in \"created by\" column. This will replace your \"Requestor Name\" column. <\/p>

Thank you!<\/p>


<\/p>

\n
\n \n \"Screen<\/img><\/a>\n <\/div>\n<\/div>\n
\n
\n \n \"Screen<\/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":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":204,"urlcode":"forms","name":"Forms"},{"tagID":247,"urlcode":"contacts","name":"Contacts"},{"tagID":334,"urlcode":"automations","name":"Automations"},{"tagID":448,"urlcode":"workflows-in-smartsheet","name":"Workflows in Smartsheet"},{"tagID":527,"urlcode":"columns","name":"columns"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&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 Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts