List of months between two dates entered in Excel

jassi2006

New Member
Joined
May 3, 2020
Messages
22
Office Version
  1. 2019
  2. 2016
  3. 2007
Platform
  1. Windows
  2. Mobile
  3. Web
I just want to create list of months between two dates entered in Excel.

something like this

If given date in Cell A1 = 12-03-2020 and in Cell B1 = 25-06-2020

Then the result in Column A wanted to be as under
A2 12-03-2020 to 31-03-2020
A3 04-2020
A4 05-2020
A5 01-06-2020 to 25-06-2020

OR it may also be ok
A2 12-03-2020 to 31-03-2020
A3 01-04-2020 to 30-04-2020
A4 01-05-2020 to 31-05-2020
A5 01-06-2020 to 25-06-2020
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi jassi2006,

Put this formula into cell A3 and copy down till it returns a blank (cell A5 in this case):

=IFERROR(IF(MONTH(A2)<MONTH($B$2)-1,TEXT(EOMONTH(A2,1),"mm-yyyy"),TEXT(DATE(YEAR($B$2),MONTH($B$2),1),"dd-mm-yyyy") & " to " & TEXT(EOMONTH($B$2,0),"dd-mm-yyyy")),"")

Regards,

Robert
 
Upvote 0
Hi jassi2006,

Put this formula into cell A3 and copy down till it returns a blank (cell A5 in this case):

=IFERROR(IF(MONTH(A2)<MONTH($B$2)-1,TEXT(EOMONTH(A2,1),"mm-yyyy"),TEXT(DATE(YEAR($B$2),MONTH($B$2),1),"dd-mm-yyyy") & " to " & TEXT(EOMONTH($B$2,0),"dd-mm-yyyy")),"")

Regards,

Robert

Its not working sir.......
 
Upvote 0
If possible please provide VBA Solution as I have data above and below calculation.

Thanks
 
Upvote 0
Its not working sir

That's odd - it worked for me :confused: Make sure what's in cells A1 and B1 are actually dates not text (strings) that look like dates.

If possible please provide VBA Solution as I have data above and below calculation.

Need to determine the format of the dates first.
 
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top