formula to display all the months between two dates

bleeet

Board Regular
Joined
May 11, 2009
Messages
208
Office Version
  1. 2013
Platform
  1. Windows
Hi guys

does anyone happen to know a formula I can use that will display all the months between a start date and the end date?

ultimately I want to make a diagram that displays all the months from start to end between two dates


thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
So lets say your start date is in A1 and your end date is in B1.

If you want your results to include the start and end months, then in D1 type:
=EDATE(A1,0)

then in E1 type:
=IFERROR(IF(EDATE(D1,1)>$B$1,"",EDATE(D1,1)),"")


If you want your results to exclude the start and end months, then in D1 type:
=EDATE(A1,1)

then in E1 type:
=IFERROR(IF(EDATE(D1,1)>=$B$1,"",EDATE(D1,1)),"")

Then copy to the right for as many cells as you're likely to need. (so if there's usually only 1 year between the two dates, then you need to copy over to 12 cells)

Perhaps format the cells as "mmm yy", otherwise you may and up with a serial number instead of a date
 
Upvote 0
So lets say your start date is in A1 and your end date is in B1.

If you want your results to include the start and end months, then in D1 type:
=EDATE(A1,0)

then in E1 type:
=IFERROR(IF(EDATE(D1,1)>$B$1,"",EDATE(D1,1)),"")


If you want your results to exclude the start and end months, then in D1 type:
=EDATE(A1,1)

then in E1 type:
=IFERROR(IF(EDATE(D1,1)>=$B$1,"",EDATE(D1,1)),"")

Then copy to the right for as many cells as you're likely to need. (so if there's usually only 1 year between the two dates, then you need to copy over to 12 cells)

Perhaps format the cells as "mmm yy", otherwise you may and up with a serial number instead of a date

thank you I will try this out

I have another question can you explain this =IFERROR(IF(EDATE(D1,1)>$B$1,"",EDATE(D1,1)),"") I trying to understand the $B$1

thanks again
 
Upvote 0
thank you I will try this out

I have another question can you explain this =IFERROR(IF(EDATE(D1,1)>$B$1,"",EDATE(D1,1)),"") I trying to understand the $B$1

thanks again

B1 is where I put the ‘end date’ In my example.
So the formula is saying “if the cell to the left +1 month is greater than the end date, then show nothing, Otherwise show the cell to the left +1 month”
It is surrounded by dollar signs to make it an absolute reference (so when you copy the formula to the left, the focus stays on B1)
 
Last edited:
Upvote 0
B1 is where I put the ‘end date’ In my example.
So the formula is saying “if the cell to the left +1 month is greater than the end date, then show nothing, Otherwise show the cell to the left +1 month”
It is surrounded by dollar signs to make it an absolute reference (so when you copy the formula to the left, the focus stays on B1)

thanks so much

sorry I am asking because I am trying to learn how to do this myself
 
Upvote 0
thanks so much

sorry I am asking because I am trying to learn how to do this myself

You're welcome. I’m only learning myself, and there are probably more efficient ways to do it than my suggestion. But that’s how I would do it at my current skill level.
 
Upvote 0

Forum statistics

Threads
1,214,518
Messages
6,119,985
Members
448,935
Latest member
ijat

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