COUNTIFS - Values in Multiple Columns and the Date is this month
I'm trying to calculate the number of cells in a multi column range that match a value in a cell and where the date is greater than or equal to the first of this month.
Source Data
Date1 C1 C2 C3
1/10/21 A B
1/11/21 A
New Sheet
Value
A
B
=COUNTIFS({SourceC1-C2}, HAS(@cell, [Value]@row))
------This will give me the total count with that value.
=COUNTIFS({Date1}, AND((IFERROR(MONTH(@cell), 0) = (MONTH(TODAY()))),(IFERROR(YEAR(@cell), 0) = (MONTH(TODAY())))
-----This will give me the total count of those dates.
=COUNTIFS({SourceC1-C2}, HAS(@cell, [Value]@row),{Date1}, AND((IFERROR(MONTH(@cell), 0) = (MONTH(TODAY()))),(IFERROR(YEAR(@cell), 0) = (MONTH(TODAY())))
-----This returns #INCORRECT ARGUMENT SET
-------If Value is 'A' I want 2. If Value is 'B', I want 1.
Best Answer
-
You could have a helper in the source that uses a join to concatenate all of the values into a single column, then reference that
Answers
-
Usually the incorrect argument error is a range size error. did you make sure your {sourceC1-C2} and {Date1} references contain the same number of cells?
-
Date1 is a single column. For the source I'm asking it to look at multiple columns. Maybe this isn't possible.
Date1:
Source:
-
You could have a helper in the source that uses a join to concatenate all of the values into a single column, then reference that
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!