# IF formula dependent on value being positive or negative

#### DanShaw92

##### New Member
Hi

Im working on an spreadsheet to calculate wages for employees

Im trying to create a formula to calc their overtime. Ive currently got a column showing how many hours over they have worked, and a column showing how many hours theyve been off that week. then a 3rd column showing the net of these two columns.

normally id just have it calc the net hours times by their hourly rate, but we pay and overtime rate of 1.5hours.

The trouble comes when someone is off for more hours than they work over. lets say someone misses a day and are therefore 8 hours down this week, the formula thinks theyve been off for 8 x 1.5 hours.

Can anyone help me out?

And feedback would be greatly appreciated

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### DanShaw92

##### New Member
What id like to have is a formula that determines if the net hours figure is positive or negative and applies the correct rate as applicable

#### jasonb75

##### Well-known Member
Try something like

=IF(net hours > 0,net hours * hourly rate * 1.5, net hours * hourly rate)

#### DanShaw92

##### New Member
Worked a treat!

Thanks for the help

Replies
1
Views
77
Replies
7
Views
444
Replies
11
Views
332
Replies
6
Views
390
Replies
5
Views
101

1,126,906
Messages
5,621,577
Members
415,846
Latest member
nigeywigey

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back