Hi
I'm having a problem with getting excel to list all the months and year that are part of a date range between a start and finish date. Below is the example of how I want it to behave (including partial months in it's output).
Desired output
I've tried a few formulars to get this and it works apart from it only returns the month and year if it's at least a full month before the start date
Output I'm getting now
These are the formulars i've tried
I think the issue is the "m")+1 part but i can't for the life of me workout how to fix it (Lots of googling and co-piloting) but i'm just not getting anywhere. any advice would be appreciated.
I'm having a problem with getting excel to list all the months and year that are part of a date range between a start and finish date. Below is the example of how I want it to behave (including partial months in it's output).
Desired output
Start | Finish | Output (This Spills out horizontally which is fine) ""indicates the result spills into seperate cells |
10/01/2025 | 01/03/2025 | "Jan-25" "Feb-25" "Mar-25" |
31/03/2025 | 01/04/2025 | "Mar-25" "Apr-25" |
31/03/2025 | 01/05/2025 | "Mar-25" "Apr-25" "May-25" |
I've tried a few formulars to get this and it works apart from it only returns the month and year if it's at least a full month before the start date
Output I'm getting now
Start | Finish | Output |
10/01/2025 | 01/03/2025 | "Jan-25" "Feb-25" |
31/03/2025 | 01/04/2025 | "Mar-25" |
31/03/2025 | 01/05/2025 | "Mar-25" "Apr-25" |
These are the formulars i've tried
Excel Formula:
=IF($C91="", "", IF(SEQUENCE(1, DATEDIF($C91, $E91, "m")+1, 0, 1)<=DATEDIF($C91, $E91, "m")+1, TEXT(EDATE($C91, SEQUENCE(1, DATEDIF($C91, $E91, "m")+1, 0, 1)), "MMM-YY"), IF(AND(MONTH($E91)<>MONTH($C91), YEAR($E91)=YEAR($C91)), TEXT($E91, "MMM-YY"), "")))
Excel Formula:
=IF($C91="", "", TEXT(EDATE($C91, SEQUENCE(1, DATEDIF($C91, $E91, "m")+1, 0, 1)), "MMM-YY"))
I think the issue is the "m")+1 part but i can't for the life of me workout how to fix it (Lots of googling and co-piloting) but i'm just not getting anywhere. any advice would be appreciated.