Build a formula to calculate total duration in Excel when have different parameters - excel

I have an Excel table with durations of individuals and I want to calculate the total duration for each activity(in this case, for each row). Each task the individuals are performing is either a parallel one or a sequential one. And it is marked with each activity. (P for Parallel and S for Sequential). There will be a drop down menu to select whether a task is parallel or sequential.
Example table is shown below.
I want to calculate the total duration for each row. The conditions are as follows.
If all the tasks are parallel then the total duration is the maximum duration of all the tasks. (Row 1 as an example, the total duration will be 9,2 days)
If all the tasks are sequential then the total duration is the addition of all the individual durations.
(Row 5 as an example, the total duration will be 31,2 days)
If there are tasks which are mixed (both parallel and sequence)
The maximum duration of parallel tasks must be calculated. (MAX of the parallel tasks)
Total of the sequential tasks must be calculated. (SUM of the sequential tasks)
Then add the MAX of the parallel tasks and SUM of the sequential tasks.
(Row 2 as an example, the MAX of parallel tasks is 6,5 and the SUM of the sequential tasks is 16, so the total duration will be 16+6,5=22,5)
I need to build a formula in Excel 2013 for this. I tried using IF, MAX and SUM formulas, but couldn’t find the correct solution.
I want to build the formula for this. Any idea?

Use offset ranges that are the same size.
Use Aggregate for the P and SUMIF() for the S:
=IFERROR(AGGREGATE(14,6,A2:K2/(B2:L2="P"),1),0)+SUMIF(B2:L2,"S",A2:K2)
Most likely your local setting will require ; in place of the , that my local settings require:
=IFERROR(AGGREGATE(14;6;A2:K2/(B2:L2="P");1),0)+SUMIF(B2:L2;"S";A2:K2)

Related

Excel: Completed tasks in Column B with date. Need percent of completed tasks, regardless of date

I have a list of 42 tasks. I represent that those tasks are complete with a date (date completed). I want to calculate the percentage of tasks completed in row 45, but the percetage of tasks complete keep getting mixed up witht he dates. The date is just when the task was completed, and I want to know the percent of the tasks completed.
I haven't actually been able to figure out the code because the date is read. The date is irrelevant to the percentage of tasks completed, but it is needed for me to know WHEN it was done for annual training.
you can use the function COUNTA() to count the number of cells with values : put COUNTA(B1:B43), if the task with not dates have an empty cell. then to get the % you can do COUNTA(...)/42. hope it helped
Yes, you can use COUNTA(task column)/COUNTA(dates column) and also change the formatting of this cell into a number. It should work.
Formula - =COUNTA(B2:B11)/COUNTA(A2:A11)
enter image description here

Planning sampling date using several criteria in Excel

I am trying to create a sampling plan for testing of raw materials. To provide some context, the criteria I am planning to factor in are the Priority level of the materials (e.g. P1 is the highest while P3 is the lowest), the delivery date of the material (Actual date of arrival), and the sampling capacity of each day (currently the capacity is at 30 SUs). If the sampling capacity of the day is exceeded, the date will be decided by back calculating using the lead times from the production need by date.
The main issue with the previous plan was that the dates were only planned around the priority level. This meant that regardless of the delivery date, whenever a new P1 item came in, it would push all the other lower priority items back, and create a backlog of untested items.
Using arbitrary values, if the material is P1, the date will be 12 days after the delivery date; P2, 13 days and P3, 14 days. After that, check if the sampling capacity is exceeded for the day. I tried to use Vlookup, but it only returns the first value rather than checking every row. I do not have Xlookup because I'm using Excel2016.
I want to create a code (either in VBA or excel) to factor in all these criteria to automatically plan a date.
The formula for sampling date based on just the priority level is =IF(C337="1", B337+12,IF(C337="2", B337+13,IF(C337="3",B337+14,""))), where C is the priority and B is the delivery date. This is what I currently have:
See below screenshot:

calculating absenteeism per interval

Dears,
i worked on a new task to calculate the scheduled & abs% per interval, so i make this sheet by query and I'm asking if there something easier than what i create or not
i need to see the same data in the highlighted columns with purple to be generated automatically in the pivot table as i did it by equations
i need the the pivot sum the scheduled agents per interval and minus the scheduled agents if we the time exceeded 9 hours
for more details please check the below hyperlink.
https://docs.google.com/spreadsheets/d/1ZyhXRLXKnXJsogcGp_Rc1iJswdCoE4Xk/edit?usp=sharing&ouid=114987741753402000397&rtpof=true&sd=true

Excel Solver solver is messing up my optimization

I have set up an optimization problem but i must be doing something wrong and I could use your help. I have three firms: alpha, Bravo, Charlie. They each complete three tasks: Milling, Inspecting, Drilling. They each require different amounts of minutes to complete each task. Alpha requires 12 minutes to mill, 5 minutes to inspect and 10 minutes to drill. Bravo requires 10 minutes to mill, 4 to inspect, and 8 to drill. Charlie requires 8 to mill, 4 to inspect, and 16 to drill. After each firm completes all of these tasks they will earn a certain amount of profit, Alpha will earn $2.40, Bravo will earn $2.50, and Charlie will earn $3.00. All three firms have a maximum allotted time of 1200 minutes to mill, 900 to inspect, and 1440 to drill. The goal is to maximize the profit of these three firms. I have set it up so that the sums of the tasks will take away from the available time left when changed by the solver. I have also set constraints within the solver to cap each task to the allotted time allowed per task. I must be missing a vital step however because it keeps trying to just max out the allotted time for an individual firm, not taking in to account the opportunity cost of the other firms or something. Please help! (shown in photos)
Data
Solver
After executing Solver
I have changed the logic a bit different in order to take the minimum unit into consideration:
UNITS portion are the variable cells. Since the final produced unit will be the minimum of these cells, E9 formula is =MIN(B9:D9) and copied down.
TIME portion is multiplication of Unit Times and Units. So the formula of B14 is =B9*B2 and copied down & right.
I9:I11 are the earnings calculated by multiplying the unit earning with the minimum units
I12 is our total earning and is our Objective cell.
Please also be careful about the constraints since when you do not set an integer constrain, finding a solution becomes more difficult and of course our units should be integer in any case.
And also fill B9:D11 cells with some values such as 100, since otherwise iteration does not start correctly and solver ends up with a very small objective cell.
I have just had a go at this and I get a different answer as I have made the assumption that to achieve the profit the company must complete a milling process, then inspect, then drill and once all are complete then that is 1 unit for the profit - I hope that is valid.
But if not, then this layout may help you anyway. Note I have set this as a Linear model for the solver and also note the use of integer and non-negative.
It was fun anyway !

10 millisecond data - need to group in 15 minute blocks and apply log average to each block

I have a set of data taken at 10 millisecond intervals. I need to group this data into 15 minute blocks (9,000 milliseconds) and obtain the log average from one column and the 10th lowest percentile from the other (my data is in decibels).
Is there a way I can split the data every 9,000th row and form groups from this, and then apply a formula to each group - without having to repeat the process for each group? i.e. some way to set it up so I can just drag down results (I have two weeks of data.)
To calculate average of rows 1-9000 in column A you can use following formula:
=AVERAGE(INDEX(A:A,(ROWS($1:1)-1)*9000+1):INDEX(A:A,(ROWS($1:1))*9000))
If you drag it down, next one will calculate rows 9001-18000 and so on.

Resources