Calculating error with if

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,077
Hello All,

I put together this formula that is supposed to be calculating overtime and it works if the hours exceed 40 but not less than 40. Can anybody assist me with this?

Code:
=(IF(S91>40,40*T91,S91*T91))+(IF(S91>40,((S91-40)*U91),""))

S column is hours worked
T column is regular pay rate
U column is overtime pay rate
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
=(IF(S91>40,40*T91,S91*T91))+(IF(S91>40,((S91-40)*U91),0))

it is trying to add a number to "" and is resulting in an error. I think that is what is causing you issues. Change the "" to 0.
 
Upvote 0
Hi,

I think your formula should be:

Code:
=IF(S91>40,40*T91+(S91-40)*U91,S91*T91)
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,303
Members
449,218
Latest member
Excel Master

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top