Use the "if" formula to calculate a certain time interval

3

I'm trying to create a condition but I'm having difficulty, can anyone help me?

If cell number c15 is between -00: 10 and 0:10 (minutes) cell d15 should appear 0:00, otherwise cell d15 should show the same cell number c15. How to measure this condition.

Thank you in advance

    
asked by anonymous 27.07.2016 / 15:11

1 answer

4

Excel does not work (does operations) with negative hours, you are probably treating the time as a string (eg:="00:05").

In this case, even for a string, Excel understands that it is hours if it is positive, either in the standard format "00:00:00" or other, in case your list of formats for time contemplate 00:00 .

So, since between "00:10" minutes and "- 00:10" minutes, values are between 0 and 10 in "absolute values", do the following:

  • Remove the negative time sign to make the comparison

  • In another cell, take the "Value" of this time, like this:

    = Value (A1)

  • The result will be a number representing this time for Excel . As "00:10" minutes equals 0,000115740740740741 , if the cell is between this value and 0, the time is in the range you want.

  • I did the test using the time like this:

      

    ="00:00:09"

         

    ="00:00:10"

         

    ="00:00:11"

    And the formula:

    =Se(Valor(C15)<0,000115740740740741;"00:00:00";C15)
    

    or better ...

    =Se(Valor(C15)<Valor("00:00:10");"00:00:00";C15)
    

    Just adapt to your case and apply!

        
    27.07.2016 / 16:04