SOLVED

New Contributor

# countif in a table with formulas

I simply have a table... in my case I have dates eg 2022-10-01, 2022-11-01, 2022,-10-02, 2022-09-01, 2022-10-04 ---- and I called this Table1

I simply want to count the number of entries eg in October i.e something like

=countif(Table1, month(Table1[@])=10)

But

1) the formula above returns 0... although if I use it =MONTH(Table1[@]) in a separate column it will bring the correct result (and then I calculate sumif on this column )

2) a formula like =COUNTIF(Table4,MONTH(Table4[Column1])=10) expands the value zero to rows below....

Any hint please how I can use it?

TIA!

4 Replies
best response confirmed by luispsimoes (New Contributor)
Solution

# Re: countif in a table with formulas

With the following formula you get your desired result:

``=SUM(--(MONTH(Table1[Date])=10))``

# Re: countif in a table with formulas

uau!... I would have never come to this one!.... man!......

Still looks a mystery... I would think the SUMIFS was the one to go.
but YOU NAILED it

Thanks!!!

# Re: countif in a table with formulas

as an add on - why doesn’t the criteria work on the countifs?

seems the criteria can’t evaluate expressions - just make simple comparisons….

is this a limitation of my version or is it excell?

thanks!

# Re: countif in a table with formulas

The criteria argument of COUNTIF must be something like ">0" or "January" or \$B\$2, not an expression that evaluates a range.