Forum Discussion

Albaman83's avatar
Albaman83
Copper Contributor
Jun 06, 2020
Solved

Issue with IF multiple formula with 3 outcomes

Hi Guys,   I have the following formula: =IF([@[Delivered?]]="NO","Warranty not Active",IF(DATEDIF(TODAY(),H263,"D")<0,"Warranty Expired",CONCATENATE(DATEDIF(TODAY(),H263,"D")," Warranty Days Rema...
  • Riny_van_Eekelen's avatar
    Jun 06, 2020

    Albaman83 Avoid using DATEDIF() for this. It's not an official Excel function and only exists "to support older workbooks from Lotus 1-2-3. Furthermore, The DATEDIF function may calculate incorrect results under certain scenarios". (Source: MS support page in the DATEDIF function).

     

    DATEDIF expects a start date in the first element and an end date in the second. If the first element is greater than the second you get !NUM#.

     

    Use standard operators in stead. Like:

     

    =IF(date < TODAY(), "Expired", date - TODAY()& " days remaining.")

     

    Once it has passed the first test you know that warranty has not expired yet and you can safely calculate the days remaining by calculating date - TODAY()

Resources