SOLVED

countif

Copper Contributor

Hi! I would like to count the cells of a coloumn if the date in the cell is within a specific month.

for istance, I may have 5 cells with a date within January 2020, 7 cells February 2020, 15 cells April 2020 and so on.

I tried with criteria like "jan" but it doesn't work: could someone help?

3 Replies
best response confirmed by Massimo_Cotichella (Copper Contributor)
Solution

@Massimo_Cotichella 

An easy way to do this is by creating a pivot table based on your data.

Add the date field (column) to both the Rows area and the Values area.

Excel will automatically group the dates by months.

 

If you prefer to use formulas, I'd add a helper column with formulas of the form

=MONTH(...)

This will return 1 for January, 2 for February etc.

You can then use =COUNTIF(helper_column, 1) to count the number of dates in January, etc.

@Massimo_Cotichella 

 

Attached is a sheet with an example

 

=ZÄHLENWENN(F:F;">=" &B1)-ZÄHLENWENN(F:F;">" &C1)

Translated into English

=COUNTIF(F:F,">=" &B1)-COUNTIF(F:F,">" &C1)

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

* Beware of scammers posting fake support numbers here.

@Hans Vogelaar 

thank you Hans! I solved my problem by your suggestion!

Massimo

1 best response

Accepted Solutions
best response confirmed by Massimo_Cotichella (Copper Contributor)
Solution

@Massimo_Cotichella 

An easy way to do this is by creating a pivot table based on your data.

Add the date field (column) to both the Rows area and the Values area.

Excel will automatically group the dates by months.

 

If you prefer to use formulas, I'd add a helper column with formulas of the form

=MONTH(...)

This will return 1 for January, 2 for February etc.

You can then use =COUNTIF(helper_column, 1) to count the number of dates in January, etc.

View solution in original post