COUNTIF syntax - count if specific word in cell
I'm trying to count every cell in a column that has a specific word (the word "Store") in it, but I keep getting an "Incorrect Argument Set" error.
This is my formula syntax - what needs to be corrected?
=COUNTIF([Location Type]:[Location Type] = "Store")
The name of the column is "Location Type" and I would like for the function to search every row in this column. Thank you.
Comments
-
I think you have a syntax issue. You need a comma between the range and the criterion.
Sample UsageCOUNTIF(Quantity:Quantity, >25)SyntaxCOUNTIF(range, criterion)https://help.smartsheet.com/function/countif
Also if your just looking to match text I think you can also drop the operator. But play around with it a bit to see what work. The reason I say this is that if you look at the sample usage for "countifs", you'll see they are searching a range for matches to text = "T-Shirt" but no operator is needed.
Sample UsageCOUNTIFS(Quantity:Quantity, >25, [Item Name]:[Item Name], "T-Shirt")I find the syntax for countif/countifs, sumif/sumifs is quite tricky. I often need to break it down to simpler expressions just to make sure I have the formula syntax correct then I substitute back in the criteria I want to evaluate.This is something I was working on this week. It took me several tries to get it right. When I want to use countifs or sumifs I start it with a single (range, criterion) to get it working then add additional range/criterion expressions.=SUMIFS(Amount:Amount, Obj:Obj, AND(@cell <> "5282", @cell <> "5334", @cell <> "5333"))
Also if your expression doesn't seem to be working check the data type.
Hope this helps.
-
Mike,
You are correct that if you are looking for a specific value (whether number, symbol, text, or combination thereof) you don't need an operator.
=COUNTIF([Location Type]:[Location Type], "Store")
will work.
-
Thank you both! That resolved the issue.
-
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives