#VALUE error when calculating DATE difference between two cells

Hi everyone!
I am importing SQL data from my ERP to LO Calc (on a M1 Macbook Air), then trying to calculate a number of months between two columns. I have put each of the column in the “DATE” format, have gone to cell Format and moved all the cells to the YYYY/MM/DD format, but I keep getting errors when I type my formula

=DATEDIF(I1,AC1,"m")

Does anyone know what I’m doing wrong?

The explanation for that error code is:

The formula yields a value that does not corresponds to the definition, or a cell that is referenced in the formula contains a text string instead of a number.

I would first check that the “dates” you are using are in fact dates, and not strings looking like dates. View | Value Highlighting will show text cells formatted in black, formulae in green, number cells in blue, and protected cells are shown with light grey background, no matter how their display is formatted.

It is possible that when importing your data, you may not have checked Detect special numbers in the import filter.

1 Like

Also note: You can manually change the type for the columns in the import filter. Often needed for dates, if the imported dates don’t fit the locale setting of the importing computer.

Let me guess: you imported data from text files (csv) and you ignored most of the import options.