COUNTIF Formula Returns Zero in Sheet Summary
I have a very simple COUNTIF formula that isn't working in the sheet summary section. For example, I'm trying to count how many times the year "2017" appears in a column called "Tablet Year". The formula should be:
=COUNTIF([Tablet Year]:[Tablet Year], 2017)
I've also tried surrounding the "2017" in quotation marks in case it's being recognized as text rather than a number, but it still returns 0. Meanwhile, I can see 2017 appearing multiple times in that column, along with other years and blank values.
I should also mention the values I'm trying to count are being pulled into this sheet through an Index/Match column formula. Maybe I'm wrong, but I don't believe that should affect the results of a simple COUNTIF.
I also tried the formula in an individual cell and it's still not working. There are no extra spaces after the 4 digits of each year, so it should be an exact match with the criteria I'm using in the formula.
Any ideas?
Thanks!
Best Answer
-
Let try some troubleshooting to figure out what's going on in your sheet.
- Try this: =COUNTIF([Tablet Year]:[Tablet Year], FIND(2017, @cell) > 0) What did this do?
- Wrap your INDEX/MATCH formula in a VALUE function. What did this do?
Kelly
Answers
-
Let try some troubleshooting to figure out what's going on in your sheet.
- Try this: =COUNTIF([Tablet Year]:[Tablet Year], FIND(2017, @cell) > 0) What did this do?
- Wrap your INDEX/MATCH formula in a VALUE function. What did this do?
Kelly
-
This one did the trick, thank you Kelly!
=COUNTIF([Tablet Year]:[Tablet Year], FIND(2017, @cell) > 0)
Any idea why the original formula below wouldn't provide the same result?
=COUNTIF([Tablet Year]:[Tablet Year], 2017)
-
I suspected you had a leading space or apostrophe in your cells. Without seeing a screenshot of an opened cell, I can't know for sure.
I'm glad we found something that works- in my opinion it never has to be pretty, it just has to work.
Kelly
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 69 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!