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.

Select RYG color based on other cells

Holly D
Holly D
edited 12/09/19 inArchived 2017 Posts

I have a sheet with checkboxes in 3 columns, and I'd like to have an RYG symbol in a separate cell be red if 1 box is checked, yellow if 2 and green if 3. If no boxes are checked I'd like to have no RYG symbol visible. I am assuming this needs to be some combination of IF and COUNTIF, but I have tried different combinations and appealed to Smartsheet itself and just can't figure this out. Do you guys have any suggestions? Thanks!

Comments

  • Andrew DeCounter
    edited 03/29/17

    Holly,

    I recommend having a look at this help article which outlines how to write formulas to interact with the different column types:https://help.smartsheet.com/articles/2476091-frequently-asked-questions-about-using-formulas

    For example:

    =IF(Value1 > 7, "Red", IF(Value1 > 3, "Yellow", "Green"))

  • Mike Wilday
    Mike Wilday ✭✭✭✭✭✭

    Assuming your checkbox columns are called checkboxcolumn1, checkboxcolumn2, and checkboxcolumn3, then you could paste the following formula into your RGB symbol formatted column in row 1 and it should do the trick.

    =IF(countifs([checkboxcolumn1]1,1,[checkboxcolumn2]1,1,[checkboxcolumn3]1,1) = 1, "Red", IF(countifs([checkboxcolumn1]1,1,[checkboxcolumn2]1,1,[checkboxcolumn3]1,1) = 2, "Yellow", IF(countifs([checkboxcolumn1]1,1,[checkboxcolumn2]1,1,[checkboxcolumn3]1,1) = 3, "Green")))

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

    Andrew (and Mike)

    Mike's solution does not work.

    All of the COUNTIFS in his formula will return 0 or 1. COUNTIFS is not counting each of the check boxes, it is counting how many of a range is matching all of the criteria.

    Because the range is only one cell, the return will be either 0 or 1.

    So, let's first change the solution if the columns are consequetive:

    =IF(COUNTIFS([checkboxcolumn1]1:[checkboxcolumn3]1, 1) = 1, "Red", IF(COUNTIFS([checkboxcolumn1]1:[checkboxcolumn3]1, 1) = 2, "Yellow", IF(COUNTIFS([checkboxcolumn1]1:[checkboxcolumn3]1, 1) = 3, "Green")))

    This works because now the range is 3 cells.

    The non-consequetive solution is ugly as each COUNTIFS in Mike's formula needs to be replaced by 3 COUNTIF's

    IF((COUNTIF(cell1, 1) + COUNTIF(cell2,1) + COUNTIF(cell3,1))=1,"Red", ...and so on.

    Craig

  • Mike Wilday
    Mike Wilday ✭✭✭✭✭✭

    Good Catch Craig! I should test my theories before I type them!Sealed

  • Thank you so much! I think I went through all these steps at some point, got as far as the 'consecutive' solution and stalled! The checkboxes are in non-consecutive columns, so Craig's second solution is working.SmileThank you all again!

This discussion has been closed.
\"//www.santa-greenland.com/community/discussion/7789/\", [Project Lead]:[Project…","snippet":"This formula is currently working, and it is returning how many items are reviewed for each \"Project Lead\". The first part of the formula is basically saying that we would count…","categoryID":322,"dateInserted":"2023-06-29T22:39:31+00:00","dateUpdated":null,"dateLastComment":"2023-06-30T02:51:05+00:00","insertUserID":157974,"insertUser":{"userID":157974,"name":"Filippo","url":"https:\/\/community.smartsheet.com\/profile\/Filippo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-30T03:08:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":157974,"lastUser":{"userID":157974,"name":"Filippo","url":"https:\/\/community.smartsheet.com\/profile\/Filippo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-30T03:08:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":21,"score":null,"hot":3376173036,"url":"https:\/\/community.smartsheet.com\/discussion\/107113\/how-to-return-a-blank-if-we-have-a-blank-cell-using-a-countifs-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107113\/how-to-return-a-blank-if-we-have-a-blank-cell-using-a-countifs-formula","format":"Rich","lastPost":{"discussionID":107113,"commentID":383252,"name":"Re: How to return a BLANK if we have a BLANK cell using a COUNTIFS formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/383252#Comment_383252","dateInserted":"2023-06-30T02:51:05+00:00","insertUserID":157974,"insertUser":{"userID":157974,"name":"Filippo","url":"https:\/\/community.smartsheet.com\/profile\/Filippo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-30T03:08:32+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-30T02:51:53+00:00","dateAnswered":"2023-06-29T22:55:01+00:00","acceptedAnswers":[{"commentID":383233,"body":"

@Filippo<\/a>, the most inelegant but dead simple thing to do is this:<\/p>

=IF(IFERROR(COUNTIFS(Reviewer:Reviewer, <>\"//www.santa-greenland.com/community/discussion/7789/\", [Project Lead]:[Project Lead], [Project Lead]@row), \"//www.santa-greenland.com/community/discussion/7789/\")<\/strong>=0, \"//www.santa-greenland.com/community/discussion/7789/\", IFERROR(COUNTIFS(Reviewer:Reviewer, <>\"//www.santa-greenland.com/community/discussion/7789/\", [Project Lead]:[Project Lead], [Project Lead]@row), \"//www.santa-greenland.com/community/discussion/7789/\")<\/strong>)<\/p>

Simplified, it's just this:<\/p>

=IF(<your formula> = 0, \"//www.santa-greenland.com/community/discussion/7789/\", <your formula>)<\/p>"},{"commentID":383252,"body":"

Very clever Lucas! Simple IF statement logic. It works perfectly, thanks!!!<\/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":107107,"type":"question","name":"Formula that counts how many rows have a date in the past","excerpt":"Hi! I need help with creating a formula that will count how many rows in my column called End Date have dates in the past. I've tried the following and it gives an \"unparseable\" error: =COUNTIFS([End Date]:[End Date], \"<=\" & TODAY()) Thanks in advance for your help!","snippet":"Hi! I need help with creating a formula that will count how many rows in my column called End Date have dates in the past. I've tried the following and it gives an \"unparseable\"…","categoryID":322,"dateInserted":"2023-06-29T20:39:23+00:00","dateUpdated":"2023-06-29T20:39:58+00:00","dateLastComment":"2023-06-29T20:52:03+00:00","insertUserID":162796,"insertUser":{"userID":162796,"name":"Beth M","url":"https:\/\/community.smartsheet.com\/profile\/Beth%20M","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/n7ZG0TBD44T33.png","dateLastActive":"2023-06-29T21:23:37+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":162796,"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-06-30T02:47:38+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":1,"countViews":20,"score":null,"hot":3376143686,"url":"https:\/\/community.smartsheet.com\/discussion\/107107\/formula-that-counts-how-many-rows-have-a-date-in-the-past","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107107\/formula-that-counts-how-many-rows-have-a-date-in-the-past","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":107107,"commentID":383217,"name":"Re: Formula that counts how many rows have a date in the past","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/383217#Comment_383217","dateInserted":"2023-06-29T20:52:03+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-06-30T02:47:38+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-29T20:54:25+00:00","dateAnswered":"2023-06-29T20:52:03+00:00","acceptedAnswers":[{"commentID":383217,"body":"

You are very close, try this.<\/p>

=COUNTIFS([End Date]:[End Date], <= 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":[{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]},{"discussionID":107098,"type":"question","name":"HAS and Children Functions","excerpt":"I have the following column1 formula: =IF(HAS(CHILDREN([Column2]@row), \"Text\"), 1, 0) which sets the value of column1 to 1 if \"Text\" is found in any children in Column2 This formula works well for a single nested file of children. However, I have a multi-level nested file (i.e. Parent1, Child1, Parent2, Child2) and it…","snippet":"I have the following column1 formula: =IF(HAS(CHILDREN([Column2]@row), \"Text\"), 1, 0) which sets the value of column1 to 1 if \"Text\" is found in any children in Column2 This…","categoryID":322,"dateInserted":"2023-06-29T18:01:34+00:00","dateUpdated":"2023-06-29T18:25:44+00:00","dateLastComment":"2023-06-29T19:48:55+00:00","insertUserID":158378,"insertUser":{"userID":158378,"name":"Mike Dufour","url":"https:\/\/community.smartsheet.com\/profile\/Mike%20Dufour","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!DKvTQ7i6zPw!HGjTH6jjgiQ!wvw2rujGLYm","dateLastActive":"2023-06-30T01:51:55+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":158378,"lastUserID":158378,"lastUser":{"userID":158378,"name":"Mike Dufour","url":"https:\/\/community.smartsheet.com\/profile\/Mike%20Dufour","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!DKvTQ7i6zPw!HGjTH6jjgiQ!wvw2rujGLYm","dateLastActive":"2023-06-30T01:51:55+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":44,"score":null,"hot":3376131029,"url":"https:\/\/community.smartsheet.com\/discussion\/107098\/has-and-children-functions","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107098\/has-and-children-functions","format":"Rich","lastPost":{"discussionID":107098,"commentID":383208,"name":"Re: HAS and Children Functions","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/383208#Comment_383208","dateInserted":"2023-06-29T19:48:55+00:00","insertUserID":158378,"insertUser":{"userID":158378,"name":"Mike Dufour","url":"https:\/\/community.smartsheet.com\/profile\/Mike%20Dufour","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!DKvTQ7i6zPw!HGjTH6jjgiQ!wvw2rujGLYm","dateLastActive":"2023-06-30T01:51:55+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-29T19:50:03+00:00","dateAnswered":"2023-06-29T18:48:24+00:00","acceptedAnswers":[{"commentID":383194,"body":"

CHILDREN will only look at entries one level down. DESCENDANTS will look at all levels below current.<\/p>"},{"commentID":383208,"body":"

Thank you Carson, very helpful!<\/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&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