Forum Discussion

cdersarkisian's avatar
cdersarkisian
Copper Contributor
Jan 18, 2021

DatedIf Not Working

I'm trying to calculate the shelf life remaining on an item using the manufactured date & the expiration date. Using the DatedIf function I am attempting to formulate the following: =datedif(mfg_date,expir_date,"m")- this is per every forum I've found. Now when I start to enter the formula, I only get as far as =datedif(mfg_date, before I get an error message. Once I put that comma & click the second cell, the error message occurs. The two date cells are utilizing short date formating so I know that's not the issue here. 

 

Any help would be appreciated! Screenshots are attached

  • mathetes's avatar
    mathetes
    Silver Contributor

    cdersarkisian 

     

    Here's another screen shot that shows the formula works.

     

    So I'm wondering if one or both of those dates just appear to dates properly formatted, but are actually text

     

     

    • cdersarkisian's avatar
      cdersarkisian
      Copper Contributor
      I formatted them as dates using the cell formatting function so they are definitely dates
      • mathetes's avatar
        mathetes
        Silver Contributor

        cdersarkisian 

         

        Can you then, since none of our suggestions have helped yet, post a copy of the actual spreadsheet?

  • Neal__'s avatar
    Neal__
    Copper Contributor

    cdersarkisian 

     

    =([end_date]-[start_date])/365.25   (or 30.4375, etc.) 

     

     works well enough for most purposes