COUNTIFS formula not functioning how I expect
Hello,
I am expecting this formula to count the number of cells in the "FND Prepare" column that have a certain name in them, where the cell on the same row in "Prepare Status" is not green.
=COUNTIFS([FND Prepare]:[FND Prepare], HAS(@cell, "NAME"), [Prepared Status]:[Prepared Status], (@cell <> "Green"))
Does someone have an idea as to where I could be going wrong? It is returning a number - 3 - but I am counting at least a dozen cells that have her name in it where the prepare status is not green.
Thank you for any help!
Best Answer
-
Hi @PinnCason
It could be due to the blank values in Prepared Status. Try this formula.
=COUNTIFS([FND Prepare]:[FND Prepare], "Neva Pence", [Prepared Status]:[Prepared Status], OR(@cell <> "Green", @cell = ""))
Thanks,
Aravind GP| Principal Consultant
Atturra Data & Integration
M: +61493337445
E:Aravind.GP@atturra.com
W: www.atturra.com
Answers
-
Hi @PinnCason
When you write HAS in your formula, Smartsheet looks for an exact match. If NAME appears as part of another text, like First Name, Smartsheet will not pick this up. Switch the formula as below.
=COUNTIFS([FND Prepare]:[FND Prepare], CONTAINS("NAME", @cell), [Prepared Status]:[Prepared Status], (@cell <> "Green"))
OR
=COUNTIFS([FND Prepare]:[FND Prepare], CONTAINS("NAME", @cell), [Prepared Status]:[Prepared Status], <> "Green")
Thanks,
Aravind GP| Principal Consultant
Atturra Data & Integration
M: +61493337445
E:Aravind.GP@atturra.com
W: www.atturra.com
-
Hey @AravindGP,
Thank you for your help. Unfortunately both formulas provided are returning an incorrect number - now 0. Please see screenshot attached for context. Is there anything else that could be going wrong here?
-
Hi @PinnCason
It looks like the column is a single select Contact List column. Since there could be only one value, you can try this formula to make it work.
=COUNTIFS([FND Prepare]:[FND Prepare], "Neva Pence", [Prepared Status]:[Prepared Status], <>"Green")
Thanks,
Aravind GP| Principal Consultant
Atturra Data & Integration
M: +61493337445
E:Aravind.GP@atturra.com
W: www.atturra.com
-
@AravindGP, the new formula is still returning a value of three, which per the screenshot is not accurate. You are correct that the name column is single select. Choosing "restrict column to list values only" does not solve my issue either.
Could the problem be somewhere in the way Smartsheet is interpreting the names that are input in that column?
Thank you,
-
Hi @PinnCason
It could be due to the blank values in Prepared Status. Try this formula.
=COUNTIFS([FND Prepare]:[FND Prepare], "Neva Pence", [Prepared Status]:[Prepared Status], OR(@cell <> "Green", @cell = ""))
Thanks,
Aravind GP| Principal Consultant
Atturra Data & Integration
M: +61493337445
E:Aravind.GP@atturra.com
W: www.atturra.com
-
Hey @AravindGP,
Looks like this is the correct solution. the formula was indeed not counting empty cells.
Thank you so much for your help!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!