0

It should be simple, but it's not working. It seems like the same question as Google Spreadsheet, Count IF contains a string but it still doesn't work. And the semicolon mentioned in the responses of that question just gets eaten, so I'm guessing that's an old format.

Basically I have a column of years (it's not designated as a date column) and I want to return total decade counts. I put:

=COUNTIF(A1:A100, "200?")

I thought that would return a count value for everything from 2000-2009, but it just returns zero. If I remove the wildcard and make it one specific year, I do get a count for that year, so it's the wildcard that's the problem. I've tried "?" and "*" and neither work. What am I doing wrong here? Everything I've read says, including the Google COUNTIF documentation says this should work.

Screenshot of my spreadsheet formula

bjd
  • 11
  • 1
  • 2
  • why don't you check if it's between 2000 and 2009? – Liora Haydont Jun 28 '18 at 20:28
  • That's a really good point. I guess I just got tunnel vision on using a wildcard. Now that you say that, I'm guessing that wildcards don't work with numbers, only strings. Thanks – bjd Jun 28 '18 at 21:08

1 Answers1

0

What am I doing wrong here?

You are misreading the documentation.

The documentation as referenced mentions wildcards only in the context If range contains text to check against,.

Number formats can however be changed to Text "on the fly" (ie within a formula), such as suggested by @TheMaster, or a different approach taken suited to the format, as in a Comment.

pnuts
  • 58,317
  • 11
  • 87
  • 139