SOLVED

Test if day of month falls between two dates

Copper Contributor

I've been trying to relay a month-month formula in Excel 2013. Where if a Date value is inputted in a cell, another cell (with formula) would display "1st date of month-last date of month" i.e. - if A1 reads "4-1-19" A2 would read "4/1/19-4/30/19". 

if A1 reads "5-1-19" A2 would read "5/1/19-5/31/19" so forth and so on...

Is this even a function in Excel?

5 Replies

@nvega 

It could be

=TEXT(EOMONTH(A1,-1)+1,"m/d/yy") & " - " & TEXT(EOMONTH(A1,0),"m/d/yy")
best response confirmed by nvega (Copper Contributor)
Solution

@nvega 

Hi
You can use one of 2 functions (EOMONTH or DATE) in combination with a TEXT function to set the formatting you want. Since the EOMONTH has been already provided, then here is the other one

You can use the formula

=TEXT(DATE(YEAR(A1),MONTH(A1),1),"mm/dd/yy")&

" - "&TEXT(DATE(YEAR(A1),MONTH(A1)+1,0),"mm/dd/YY")

Hope that helps

Nabil Mourad

worked! thanks a million @nabilmourad 

@nvega 

I'm glad I could help... Good Luck

Nabil Mourad

worked also, thank you! @Sergei Baklan 

1 best response

Accepted Solutions
best response confirmed by nvega (Copper Contributor)
Solution

@nvega 

Hi
You can use one of 2 functions (EOMONTH or DATE) in combination with a TEXT function to set the formatting you want. Since the EOMONTH has been already provided, then here is the other one

You can use the formula

=TEXT(DATE(YEAR(A1),MONTH(A1),1),"mm/dd/yy")&

" - "&TEXT(DATE(YEAR(A1),MONTH(A1)+1,0),"mm/dd/YY")

Hope that helps

Nabil Mourad

View solution in original post