#VALUE! error in excel when trying to find the difference between 2 date/time cells

Shams Mahmud 100 Reputation points
2026-06-10T21:11:27.8633333+00:00

Hello,

I am trying to calculate the work duration (in mins) for a job. The following snippet shows selected rows for Cols K:M. The formula in Col K & L are using text and concat functions to create a date and time cell. Col M is simply calculating the difference and converting it into minutes:

User's image

The above formula references cell K4196. The following snippet shows the formula in cell L4196:

User's image

the last snippet references cell M4196 and shows the calculation for minutes:

User's image

The frustrating part is that when I view this file from my MSFT Edge browser the formula in Col M is returning with the calculated value. It's only when I download the file in MSFT Excel that I get the #VALUE! error. Lastly, the current format in Cols K and L is Time. Also, the format for cell M is number with an active Data Validation rule to allow only Decimal with Min and Max values between -1,000,000 and 1,000,000.

I am wondering if there is a workaround. I tried to enclose the cell references in Col M with Value() but to no avail. I also tried to remove the spaces in the formulas under Cols K and L. Can you please provide with any text manipulation tips so that I can calculate this correctly within MSFT Excel.

Regards,

Shams.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author
Hendrix-C 20,015 Reputation points Microsoft External Staff Moderator
2026-06-10T21:50:44.2566667+00:00

Hi @Shams Mahmud,

Based on your sharing, the issue is that the data in your column K and L are text strings, not real Excel date/time values. In your formulas, you use TEXT() formula to convert the date and time into text like "01/24/2026 04:00:00". Excel can display the data nicely but since it's not a numeric datetime data, the time subtraction would fail as expected.

Moreover, the formula in cell M4196 =IF(K4196="", 0, L4196-K4196*24*60) has a wrong order of operations. Excel reads that formula as L4196 - (K4196*24*60) while your expected outcome should be (L4196-K4196)*24*60.

In this case, the best option is to store value in column K and L in read datetime values. However, there is a faster workaround is to use this revised formula instead in cell M4196:

=IF(K4196="",0,(VALUE(L4196)-VALUE(K4196))*24*60)

Please try the formula and let me know if it works for your situation. If not, please notify me and we can work together to find a solution.

If you have any questions or need any further clarification, please leave a comment here and I will be happy to continue to help you.  

Thank you for your patience and understanding. I'm looking forward to your reply.


If the answer is helpful, please click "Accept Answer" and kindly upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

Was this answer helpful?

2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.