Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Use array to calculate incremental weekly costs based on hours worked and rate of pay

Posted on 2011-03-09
3
326 Views
Last Modified: 2012-05-11
Looking to caculate total incremental costs on a weekly basis utilizing an array formula.  In the attached file, you will notice columns for an individual's Straight Time and Over Time rates, then columns for dates where hours worked is input.  For the pay cycle (two weeks period with the border), the OT rate only comes into play if 80+ hours are worked in that two week period.  Now if more than 80 hours are worked in one week, then all hours worked in the next week are OT.  It then resets once the two week cycle is complete.

What I need is to calculate on a WEEKLY basis.  So you would have to take in consideration the pay cycle (two weeks in the border) and then show the cost for that specific week based on the total hours in that cycle.

For example...
1) on the first week of the cycle John works 50 hours and the second week he works 30.  All of that time would be ST pay for both weeks.
2) on the first week of the cycle John works 60 hours and the second week he works 60.  It would be 60 hours ST for the first week then 20 hours ST and 40 hours OT for the second week.
3) on the first week of the cycle John works 85 hours and the second week he works 50.  It would be 80 hours ST and 5 hours OT for the first week then 50 hours OT for the second.
 EE-sample.xlsx EE-sample.xlsx
0
Comment
Question by:KaseyM
  • 2
3 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 35084359
Hello KaseyM, you can use this formula in D2

=SUM(IF(D4:D9>80,80,D4:D9)*$B4:$B9+IF(D4:D9>80,D4:D9-80)*$C4:$C9)

and then this one in E2

=SUM(IF(D4:D9+E4:E9>80,80,D4:D9+E4:E9)*$B4:$B9+IF(D4:D9+E4:E9>80,D4:D9+E4:E9-80)*$C4:$C9)-D2

both confirmed with CTRL+SHIFT+ENTER

Then you can select the range D2:E2 and drag across the other columns, see attached

regards, barry
26874262.xlsx
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35084526
Note if you wanted to use simpler non-array formulas , i.e.

=MIN(80,D4)*$B4+MAX(0,D4-80)*$C4

and

=MIN(80,D4+E4)*$B4+MAX(0,D4+E4-80)*$C4-D14

you could do the calculations one row at a time - I include that on this version, rows 14 to 19. The totals in row 21 should match the totals in row 2, see attached

regards, barry
26874262v2.xlsx
0
 

Author Closing Comment

by:KaseyM
ID: 35085559
Worked like a charm.  Thanks for your speedy response.  I really like the array formulas...just a little tricky after doing it the other way for so many years.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question