#VALUE! error with date/time subtraction

dembry

New Member
Joined
Jan 21, 2005
Messages
5
Hello,

My friend is trying to subtract two date/time values to determine the time difference between them. For example, in cell B2 we have:

1/13/2005 18:30:15

and in cell A2 we have:

1/13/2005 13:09:26

When she tries entering the formula =B2-A2 in her spreadsheet, she gets a #VALUE error. She sent me the exact same spreadsheet but when I enter the same formula =B2-A2, it returns the correct answer (0.222 days). In other similar calculations, sometimes she does not get the #VALUE error but will get either a correct or incorrect answer.

I also noticed that cell B2 and A2 do not respond to formatting changes. We are both using Excel 2000 but the information originally came from a database query. Any idea why I can perform these calculations correctly but she can't? Is there some kind of underlying formatting that is altering her spreadsheet?

Thanks if you can help!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Davers

Well-known Member
Joined
Sep 17, 2002
Messages
1,165
It sounds like your data may be exporting from the database as text, not as a time. Try mulitplying both values by 1 and see if that converts it to a number.

Dave
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,533
Messages
5,854,291
Members
431,636
Latest member
shabbas313

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top