Forum Discussion

Rajen66's avatar
Rajen66
Copper Contributor
Feb 02, 2023
Solved

datedif function

Hi 

I am using a MacBook Air.  When trying to use the datedif function to subtract two dates, it prevents me from selecting the second date, it returns the following error "There's a problem with this formula" .  I have watched a number of you tube videos where this error is not covered.  Could you assist.

  • Rajen66 On a MBA myself. No problems with DATEDIF. But I wonder why you want to use that function at all. It's not an official Excel function and exists only for compatibility reasons with older spreadsheet programs (like Lotus-1-2-3).

     

    If the earlier date is in A1 and the later date in B1 you can just use:

    =B1-A1 and format the cell as a number, in stead of =DATEDIF(A1,B1,"d")

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Rajen66 On a MBA myself. No problems with DATEDIF. But I wonder why you want to use that function at all. It's not an official Excel function and exists only for compatibility reasons with older spreadsheet programs (like Lotus-1-2-3).

     

    If the earlier date is in A1 and the later date in B1 you can just use:

    =B1-A1 and format the cell as a number, in stead of =DATEDIF(A1,B1,"d")

    • Rajen66's avatar
      Rajen66
      Copper Contributor
      Hi Riny

      You are quite correct, I found that out as well and switched over to the method you proposed. Goodluck with your MBA. I completed mine in 2010 and it really opened a different dimension on finding solutions to problems.
  • Rajen66 

    Do you use comma as decimal separator? If so, you should use semicolon between the arguments of the function. For example:

     

    =DATEDIF(A1; B1; "Y")

    • Rajen66's avatar
      Rajen66
      Copper Contributor
      Hi Hans

      Thanks, I have tried this as well but it still comes up with the same error.

Resources