SOLVED
Home

IF Function to calculate multiple OT rates

%3CLINGO-SUB%20id%3D%22lingo-sub-856337%22%20slang%3D%22en-US%22%3EIF%20Function%20to%20calculate%20multiple%20OT%20rates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-856337%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20struggling%20to%20write%20an%20IF%20formula%20that%20will%20calculate%20the%20gross%20pay%20based%20upon%20the%20following%20information%3A%3C%2FP%3E%3CP%3EDept.%201%20employees%20receive%20straight%20time%20for%2040%20hours%20or%20less%20and%20double%20time%20for%20hours%20over%2040.%3C%2FP%3E%3CP%3EDept.%202%20employees%20receive%20straight%20time%20for%2040%20hours%20or%20less%20and%20triple%20time%20for%20hours%20over%2040.%3C%2FP%3E%3CP%3EName%26nbsp%3B%20%26nbsp%3BDept.%26nbsp%3B%20%26nbsp%3BRate%26nbsp%3B%20%26nbsp%3BHours%26nbsp%3B%20%26nbsp%3BGross%20Pay%3C%2FP%3E%3CP%3ESally%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B1%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2410%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2020%3C%2FP%3E%3CP%3EJoe%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B2%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2410%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2050%3C%2FP%3E%3CP%3EJill%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2420%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2044%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-856337%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-856366%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20Function%20to%20calculate%20multiple%20OT%20rates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-856366%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F409244%22%20target%3D%22_blank%22%3E%40maynardc%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20first%20name%20in%20cell%20A2%2C%20put%20this%20formula%20in%20cell%20E2%20and%20copy%20down%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DIF(D2%26lt%3B%3D40%2CD2*C2%2C(40*C2)%2B((D2-40)*IF(B2%3D1%2C2%2C3)*C2))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20630px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F131882i866B29CF683D85A4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-09-16_10-18-47.png%22%20title%3D%222019-09-16_10-18-47.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-856591%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20Function%20to%20calculate%20multiple%20OT%20rates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-856591%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F409244%22%20target%3D%22_blank%22%3E%40maynardc%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnother%20variant%20for%20E2%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20315px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F131910i4671C85ED25353D8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eis%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3D(MIN(40%2C%24D2)%2BMAX(0%2C%24D2-40)*(2%2B(%24B2%3D2)))*%24C2%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-857356%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20Function%20to%20calculate%20multiple%20OT%20rates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-857356%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F7724%22%20target%3D%22_blank%22%3E%40Ingeborg%20Hawighorst%3C%2FA%3E%26nbsp%3BThank%20you%20so%20much%20for%20the%20help%20on%20this!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-857374%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20Function%20to%20calculate%20multiple%20OT%20rates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-857374%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3BThanks%20for%20this%20variant%20and%20your%20assistance%20on%20this%20one!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-857573%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20Function%20to%20calculate%20multiple%20OT%20rates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-857573%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F409244%22%20target%3D%22_blank%22%3E%40maynardc%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20are%20welcome.%20I%20added%20another%20variant%20only%20to%20illustrate%20that%20in%20Excel%20practically%20any%20task%20could%20be%20done%20by%20several%20ways.%20Which%20one%20to%20use%20-%20it%20depends.%20But%20in%20most%20cases%20better%20to%20select%20formulas%20with%20which%20you%20are%20more%20familiar%20and%20which%20you%20understand%20better.%20It%20will%20be%20easier%20in%20maintenance.%3C%2FP%3E%3C%2FLINGO-BODY%3E
maynardc
Occasional Contributor

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

@maynardc 

 

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))

 

2019-09-16_10-18-47.png

@maynardc 

Another variant for E2

image.png

is

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

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

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

@maynardc 

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