Forum Discussion

BigDaveB's avatar
BigDaveB
Copper Contributor
Nov 17, 2021
Solved

Determine if a date belongs in a certain month

Hello all. I am new to this so hoping I am in the right place. Unfortunately I have no examples to share as I can't even begin to build a formula for what I am trying to do.   So here goes. I am tr...
  • Riny_van_Eekelen's avatar
    Nov 17, 2021

    BigDaveB That could be:

     

    =IF(DAY(A2)>=28,EOMONTH(A2,1),EOMONTH(A2,0))

     

    where the date to check is in A2.

    Custom format the cell that holds this formula as yyyy-mm

    Example attached. 

     

    Edit: This one will work also:

    =EOMONTH(A2,QUOTIENT(DAY(A2),28))

Resources