Home » excel » excel – Same formula, different results?

excel – Same formula, different results?

Posted by: admin May 14, 2020 Leave a comment

Questions:

You are my last chance to find a solution :
I have 2 cells (C6 & D6; 08:00:00 & 12:26:00) and a simple formula (=D6-C6). This one is working properly but I have another one (=IF(OR(C6="JF";C6="WE");"00:00";D6-C6)) which is quite simple but as you can see on this photo :

To help understand: enter image description here

The result of this second formula is not quite the same as the first one…which is weird as they have the same end (D6-C6)…I need either an explanation of why and a solution to have the 4:26 end on the second formula.

I’ve tried this one : (=SI(OU(C6<>"JF";C6<>"WE");D6-C6;"00:00:00")) but the result is the same (0,184722222).

How to&Answers:

There is nothing wrong per se. It’s a case of format being different. I think the easiest way here would be to make use of the format painter:

  1. Click on the cell with the format to copy (the one with the time)
  2. Click the format painter
  3. Click on the cell you want to format (the one with the decimal)

enter image description here

Otherwise format the cell with the decimal as time:

enter image description here

Answer:

It’s the same value but with different format. Just change the cell format to hh:mm:ss

Check Format numbers as dates or
times