Count days in any given month between two dates

Copper Contributor

I am trying to make a list that tells me how many of the days within a periode is in a given month.

Attached picture illustrates how i want the output (column D).

 

Any good ideas?

 

Dager.png

2 Replies

@Treklogg 

=IFERROR(DATEDIF(MAX(DATE(2022,5,1),B2),MIN(DATE(2022,5,31),C2),"d")+1,0)

Maybe with this formula.

datedif.JPG 

@Treklogg 

As variant

=SUM( --(MONTH( SEQUENCE([@End]-[@Start]+1,,[@Start]) ) = 5 ) )

image.png