• 461K Members
• 5,380 Online
• 559K Conversations
SOLVED

## IF Function to calculate multiple OT rates

Occasional Contributor

# IF Function to calculate multiple OT rates

I am struggling to write an IF formula that will calculate the gross pay based upon the following information:

Dept. 1 employees receive straight time for 40 hours or less and double time for hours over 40.

Dept. 2 employees receive straight time for 40 hours or less and triple time for hours over 40.

Name   Dept.   Rate   Hours   Gross Pay

Sally         1       \$10      20

Joe           2       \$10      50

Jill            1       \$20      44

5 Replies
Solution

# Re: IF Function to calculate multiple OT rates

With the first name in cell A2, put this formula in cell E2 and copy down:

=IF(D2<=40,D2*C2,(40*C2)+((D2-40)*IF(B2=1,2,3)*C2))

# Re: IF Function to calculate multiple OT rates

Another variant for E2

is

``=(MIN(40,\$D2)+MAX(0,\$D2-40)*(2+(\$B2=2)))*\$C2``

# Re: IF Function to calculate multiple OT rates

@Ingeborg Hawighorst Thank you so much for the help on this!

# Re: IF Function to calculate multiple OT rates

@Sergei Baklan Thanks for this variant and your assistance on this one!

# Re: IF Function to calculate multiple OT rates

You are welcome. I added another variant only to illustrate that in Excel practically any task could be done by several ways. Which one to use - it depends. But in most cases better to select formulas with which you are more familiar and which you understand better. It will be easier in maintenance.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies