# Formula calculates working hrs.

#### asyamonique

##### Well-known Member
Code:
``=IF(COUNT(E3:F3) = 2, MOD(F3-E3,1)-"8:00", "")``
Hello,
The formula given above calculating the extra hrs after 8 hrs.
Is there any way to change it if there are entries below 8hrs the formula will give me the negative result?
Sample

14:00 => 01:00 = 3
14:00 => 21:00 = -1

Many Thanks

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

##### Well-known Member
Hello,

after quite a bit of changing, but formula not very elegant

=IF(COUNT(E3:F3)=2,IF(MOD(F3-E3,1)-"8:00"<0,TEXT((((F3-E3)*24)-8),"#"),MOD(F3-E3,1)-"8:00"),"")

#### asyamonique

##### Well-known Member
Hello,
Thanks for the reply but I've got below result

 8:00 PM 3:00 AM -25

<tbody>
</tbody>

#### Tetra201

##### MrExcel MVP
Maybe

=IF(COUNT(E3:F3)=2,24*MOD(F3-E3,1)-8,"")

#### asyamonique

##### Well-known Member
Thanks but still I couldn't get correct result.