jebenexcel
Board Regular
- Joined
- Mar 16, 2018
- Messages
- 59
Hello;
I need a function (or 12) that tells me for each month how many times it appears between two dates.
So let's say I have the dates 1.1.2019 and 31.7.2020.
The output should be:
January 2
February 2
March 2
April 2
May 2
June: 2
July: 2
August: 1
September: 1
October: 1
November : 1
December: 1
It should work for cases where the two dates span less than one year, one year exactly, or more than one year.
As of now, my function works more or less, but if the dates are less than a year apart and there is a change of year in between ( say 1.8.2019-28.2.2020) it doesn't work.
The output in this case should be:
January 1
February 1
March 0
April 0
May 0
June: 0
July: 0
August: 1
September: 1
October: 1
November : 1
December: 1
Has anyone encountered this problem before and has a solution?
Thanks!
I need a function (or 12) that tells me for each month how many times it appears between two dates.
So let's say I have the dates 1.1.2019 and 31.7.2020.
The output should be:
January 2
February 2
March 2
April 2
May 2
June: 2
July: 2
August: 1
September: 1
October: 1
November : 1
December: 1
It should work for cases where the two dates span less than one year, one year exactly, or more than one year.
As of now, my function works more or less, but if the dates are less than a year apart and there is a change of year in between ( say 1.8.2019-28.2.2020) it doesn't work.
The output in this case should be:
January 1
February 1
March 0
April 0
May 0
June: 0
July: 0
August: 1
September: 1
October: 1
November : 1
December: 1
Has anyone encountered this problem before and has a solution?
Thanks!
Last edited: