Issue with Health Symbols
Assume a single parent cell with two children. Here is the formula I am using:
IF(CONTAINS("Red", CHILDREN()), "Red", IF(CONTAINS("Yellow", CHILDREN()), "Yellow", IF(COUNTIFS(CHILDREN(), "Green") = COUNT(CHILDREN()), "Green", IF(COUNTIFS(CHILDREN(), "Blue") = COUNT(CHILDREN()), "Blue")))
The issue is the Green and Blue. If any of two children are blank and I have a single Green (or Blue), the parent cell is Green (or Blue), when in fact what I need is for both children to be Green (or Blue) before the parent becomes Green (or Blue).
I would also like to add that if one is Green and one is Blue then the status should be Green.
Can anyone help?
Answers
-
Hi gmerits,
You can try the below formula satisfying your required conditions-
=IF(CONTAINS("Red", CHILDREN()), "Red", IF(CONTAINS("Yellow", CHILDREN()), "Yellow", IF(COUNTIFS(CHILDREN(), "Green") = 2, "Green", IF(COUNTIFS(CHILDREN(), "Blue") = 2, "Blue", IF(AND(CONTAINS("Green", CHILDREN()), CONTAINS("Blue", CHILDREN())), "Green")))))
Thank you.
-
I like the solution but should have mentioned the example I used with 2 cells should be generalized to x cells, so I know that I likely will need to do some kind of on AND(IF statement that looks for "" in a cell to see if it is blank. I have tried everything I know to try but keep getting parsing errors and other types of errors. So I need way to detect a blank cell and take some action if it is blue.
So changing my original statement from "If any of two children are blank" to "if any of the children are blank" would have been a better way of stating the question.
So let's assume x cells then:
- I any yellow children then yellow parent regardless of blank children.
- All children must be green with no blank children in order for the parent to be green, otherwise it should be yellow if there is green children but even a single blank child or more.
- Same goes for Blue.
- Any red child regardless of blank children should lead to a red parent.
- Any yellow child and no red children would lead to a yellow parent with or without blank cells.
- A Blue child or children mixed with a Green child or children and no blanks would lead to a Green parent.
Thanks!
-
Try this:
=IF(CONTAINS("Red", CHILDREN()), "Red", IF(CONTAINS("Yellow", CHILDREN()), "Yellow", IF(COUNTIFS(CHILDREN(), "Green") = COUNTIFS(CHILDREN(), OR(@cell = "", @cell <> "")), "Green", IF(COUNTIFS(CHILDREN(), "Blue") = COUNTIFS(CHILDREN(), OR(@cell = "", @cell <> "")), "Blue")))
-
This almost worked, but if I put Blue in a child cell, for example, and the other child cell (or cells if I have more than just 2 cells) is blank, the parent cell does not see a blue symbol. Same with Green.
Thanks!
-
I thought you only wanted it if all children were?
"The issue is the Green and Blue. If any of two children are blank and I have a single Green (or Blue), the parent cell is Green (or Blue), when in fact what I need is for both children to be Green (or Blue) before the parent becomes Green (or Blue)."
-
No, what I am looking for really has to do with dealing with blank cells that are children. I already have it setup so that if any child is yellow the parent is yellow and regardless of blank children or not. Same for red.
It is blue and green. If blue with any blank children, then the parent should be yellow. If red with any blank children, then the parent should be red. If green and blue children and one or more blanks, then the parent should be yellow. The finally, if all green children then green parent and if all blue children then blue parent. Hope that makes sense.
Thanks!
-
What if there are green and blue children with no blanks?
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives