Forum Discussion

Userpath77's avatar
Userpath77
Icon for Helper II rankHelper II
2 years ago
Solved

Compare Month and Year from Date String

Hello All   I need a formula that compares two dates: Table1[Date] and Table 2[Date] and then returns "Late" if Table1[Date] is later than Table2[Date] or "Current" if Table1[Date] is the same as T...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Userpath77 ,

     

    You can try below formula:

    Status =
    IF (
        HASONEVALUE ( Table2[Date] ),
        IF (
            ISBLANK ( MAX ( Table1[Date] ) ),
            "Pending",
            IF (
                YEAR ( MAX ( Table1[Date] ) ) = YEAR ( MAX ( Table2[Date] ) )
                    && MONTH ( MAX ( Table1[Date] ) ) = MONTH ( MAX ( Table2[Date] ) ),
                "Current",
                IF ( MAX ( Table1[Date] ) > MAX ( Table2[Date] ), "Late", "Pending" )
            )
        ),
        BLANK ()
    )

    Best Regards,
    Adamk Kong

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.