Unable to find time difference

I am trying calculate the time difference between series of date and time. Eg 25-06-2024 07:25 25-06-2024 07:30. I have tried formula =A2-A1, =(A2-A1)*1440. Still my answer value is #Value!. I am new to Libreoffice, Please I request any one to help me with this.

Thank you

Your question is not related at all with Math, LO formula editor. Please retag as calc.

https://ask.libreoffice.org/uploads/short-url/9D5ZBKUSNQPb5DBp4jJ89SrRREU.ods (first sheet)

Cause

Most likely, your input format with hyphen as date separator is not registered as an input option for dates (aka “date acceptance pattern” ; see help page)
This has then caused your date/time input to be interpreted as text. Arithmetic calculations on text entries do not give a sensible number value, which is signified by that #VALUE error.

Solution

  • Change settings for date input
    • Select menu item Tools - Options
    • In the left pane, expand the Languages and locales branch and select General
    • in the Date acceptance patterns input field, append ; D-M-Y to what you have there before.
      The leading semicolon is to separate the new entry from the others that you have there
  • Your timestamp format now is useable as a source for calculation.
    To make it work, either …
    • Enter your timestamps again to have them accepted as proper date/time value
      … or …
    • Use the VALUE() function to convert text timestamps to proper date/time value

If you enter dates in this format, you may want to also apply that
DD-MM-YYYY HH:MM
formatting on your cells.

Hello Kjell, Thank you very much for your help. It was a big help.

1 Like