#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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

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
Back
Top