lundi 8 novembre 2021

Excel formula not working while trying to calculate overtime or lesser time

I need to create a formula which will return overtime/lesser-time of employees based upon time duration.

I want to put the formula in column Q.

enter image description here

The requirement is such that -

  • If Total Duration(column O) is 0, then OT Hours = 0.
  • If Total Duration is >12 and Employment Type = Contractor, OT Hours = 12-O6 else O6-12.
  • If Total Duration is >8 and Employment Type <> Contractor, OT Hours = 8-O6 else O6-8.

I have entered the following formula but it is not working.

=IF(O6<>0,((IF(AND(D6<>"Contractor",O6>8),O6-8,8-O6),IF(AND(D6="Contractor",O6>12),O6-12,12-`O6))),0)`

Aucun commentaire:

Enregistrer un commentaire