-1

I have two columns in excel with datetime values and I want to get the difference between those two columns in hours.

If I try to subtract these two dates, I get #VALUE! in the resulting cell.

I tried to use datedif function of excel but it also gave me #VALUE! in the result cell.

I do not know how to get the difference.

sashoalm
  • 75,001
  • 122
  • 434
  • 781
Arpita
  • 445
  • 3
  • 14
  • 28

1 Answers1

1

If you are getting a #VALUE! error when simply substracting the dates, it means that at least one of those values is actually not a date but probably just a string. You may need to convert them to Date first.

To check if Excel thinks of your value as of date, try to set a different format of the date, or call a =DAY(yourCell) function on it. If it returns a number, it is a date, if it returns #VALUE!, it is not.

Marek Stejskal
  • 2,698
  • 1
  • 20
  • 30
  • Yes. For one column, I got the number and for another I got #Value!. How to convert the second column to proper date format? – Arpita Feb 03 '15 at 15:12
  • That depends on the text. The DATEVALUE() function might help, but you may still need to search a bit. – Marek Stejskal Feb 03 '15 at 15:19