In following Excel sheet, there are dates in column `A2:A23` in the format `dd-mm-yyyy`. In `B2:B23` days are written using formula `=TEXT(A2,"ddd")`. In column `C2:C23` entries "Y" or "N" are made. The entries have been made for every month from October 2016 to March 2017 in column `C`. How I can automatically write all the months from range `A2:A23`, say for example in column `E` and display number of "Y/N" entries corresponding to every month?

For example, I want to see result like given in columns `E` and `F`. The entries in `E` and `F` are manually filled, but I want to fill these entries automatically.

I am aware of formula like `=SUMPRODUCT(--(MONTH(A2:A23)=MONTH(E)))`, but for this, I need to manually write months in column `E` from `A2:A23`.

```
+------------+-----+------------+--+-------+---------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|    Date    | Day | Entry(Y/N) |  | Month | Number of Y/N |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+------------+-----+------------+--+-------+---------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| 15-10-2016 | Sat | Y          |  | Oct   |             4 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 17-10-2016 | Mon | Y          |  | Nov   |             5 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 19-10-2016 | Wed | Y          |  | Dec   |             5 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 23-10-2016 | Sun | Y          |  | Jan   |             4 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 01-11-2016 | Tue | Y          |  | Feb   |             2 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 05-11-2016 | Sat | N          |  | Mar   |             2 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 11-11-2016 | Fri | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 15-11-2016 | Tue | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 22-11-2016 | Tue | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 05-12-2016 | Mon | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 09-12-2016 | Fri | N          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 11-12-2016 | Sun | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 23-12-2016 | Fri | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 26-12-2016 | Mon | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 02-01-2017 | Mon | N          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 08-01-2017 | Sun | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 10-01-2017 | Tue | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 22-01-2017 | Sun | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 08-02-2017 | Wed | N          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 10-02-2017 | Fri | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 11-03-2017 | Sat | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| 15-03-2017 | Wed | Y          |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|            |     |            |  |       |               |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+------------+-----+------------+--+-------+---------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

```

**Update:** Let me explain what I did. In `E2` I have written `=A2` and formatted this cell using custom format mmm which helped me to display `Oct` in `E2`, in `E3` I have used formula `=DATE(YEAR(E2),MONTH(E2)+1,DAY(E2))`, this formula helped me to display Nov in `E3` and so on. In `F2` I have written `=SUMPRODUCT(--(MONTH($A$2:$A$23)=MONTH(A2)))` which has given count 4, and subsequently in `F3` I have written `=SUMPRODUCT(--(MONTH($A$2:$A$23)=MONTH(A2)+1))`, in `F4 =SUMPRODUCT(--(MONTH($A$2:$A$23)=MONTH(A2)+2))` and so on. All is good till `Dec`, after that zero result is displayed for `Jan`, `Feb` and `March`. I think the increment in command =SUMPRODUCT(--(MONTH($A$2:$A$23)=MONTH(A2)+1)) is giving me errored result after `Dec`, which of course does not produce Jan when an increment is given month `Dec`