I am stuff on a problem regarding setting up a dynamic shift rota at work.
What it has to do is there are 3 people per team and 3 jobs to do (which they do as equals as it can be per week) and when someone is off lets call it job 3 is just not done that day.
I have been able to make it to set true or false if there in but having trouble with assigning a different job per day with priority on job numbers 1 and 2.
edit: I thought I would explain it better what I am looking for
alt text http://img688.imageshack.us/img688/3032/spreadsheet.jpg
This is the spreadsheet i have at the top is the rota 1 = in 0 = day off
I have only been working on Group 3 to get it working, In the grey next to the days at the bottom are the jobs in which that person would be doing if it was a full staff day.
What i need to do is if there are only 2 people in then they do job number 1 and 2 alternativly .
i currently have this formula it works for some combo but not all (this is formula for H33)
=IF(F9 > 0, IF(OR(F9=0,F10=0,F11 = 0),IF(OR(I33 = 1, I33 = 2),I33,I33-1),I33), 0)
Any advise woudl be great
Use this formula for John (column C row 4), and the copy it down to the other 2 people in the same day
=IF(B4="in",COUNTIF(B4:B$4,"in"),"")
for next day you should change the B$4 to B$8, etc
EDIT / I did not undestand your rotation pattern
Now, refering to the excel image you posted, for Group 1, Monday
You need two auxiliar columns
1. In P11-> =D3*E23 // To eliminate zeroes
2. Copy down P11 till P13
3. In Q11-> =IF(P11=0,"",RANK(P11,P$11:P$13,-1)) // To get 1, 2 or 3 values
4. Copy down Q11 till Q13
5. In D23 -> =IFERROR(Q11-MIN(Q$11:Q$13)+1,"") // Offset Factor 1,1-2,1-3
4. Copy down D23 till D25
It was a tricky one
Related
Im trying to duplicate data down a set of columns based on number cycle. Every time a number in sequence repeats, I'd like the number IM populating to increase by 1.
For example:
A
B
1
1
1
2
1
4
2
1
2
2
2
4
Every time column B repeats its cycle, In this case when it repeats back to 1, 2 ect. I'd like column A to increase by 1.
Initially I thought something like =IF(A3<>A2,B2+1,B2) would suffice, but that repeats.
Is there a different formula I can use to accomplish this?
Depending on your scenario, I'd do this.
These formulas need to originate in cell A2. If you're not working in the top left hand corner of your sheet, you'll need to adjust the formula accordingly.
Scenario 1 - All numbers in the sequence are unique.
=IF(INDIRECT(SUBSTITUTE(ADDRESS(1,B2),"1","") & "1") = B2, MAX($A$1:A1) + 1, MAX($A$1:A1))
Scenario 2 - All numbers in the sequence are NOT unique.
=IF(SUMIF($A$1:A1, MAX($A$1:A1), $A$1:A1) / 6 = MAX($A$1:A1), MAX($A$1:A1) + 1, MAX($A$1:A1))
an avid excel user trying to lose weight. I have put my goal at the end and projected how much I should be losing each day, however I only want to weigh myself every so often 1-5 days. The issue this bring is i want to be able to write a formula that will give an average expected.
For example, I want a formula I can just copy between the cells which aren't entered i.e.
Day, Weight
1, 100
2,
3, 98
So then copying an excel formula would give = 100-(100-98)/2 = 99
But lets take a 5 day scenario:
Input:
Day, Weight
1, 100
2,
3,
4,
5, 20
This creates an issue as
Day 2 = Day 1 - (Day 1 - Day 3)/2
Day 3 = Day 2 - (Day 2 - Day 4)/2
Day 4 = Day 3 - (Day 3 - Day 5)/2
However, this then creates dependent formulas on one another, I don't really want to change the cells in the formula each day. Do you have an idea how I can get around this?
Case 1
I have a set of data which i need to determine if the cell is in Business Hours or Not.
8 - 18 (08:00 - 18:00) Business Hours (BH)
outside the timeframe is Non Business Hours (NBH)
Given Cell value for example is = "7" (which is NBH)
here is the formula i created =if(AND(C2>=8,C2<=18 ),"BH","NBH")
Case 2
I have a set of data for days in a week, i need to determine if the cell is in Weekdays or Weekends.
I have this formula = =if(OR(I2="Saturday", I2="Sunday"), "NBH", "BH")
note : i used the same variable name NBH - Weekends , BH - Weekdays
What I really need to do is to combine those two cases into 1 formula.
I need to output these scenarios correctly, listing below :
Time is 08:00, date is Saturday/Sunday = Combined formula of case 1 and 2 should output "NBH"
Time is 07:00, date is Monday-Friday = Combined formula of case 1 and 2 should output "NBH"
Time is 12:00, date is Monday-Friday = Combined formula of case 1 and 2 should output "BH"
Formulas can be seen in column BH/NBH WEEKDAYS and BH/NBH Weekends, you can browse attached file thanks much!
Click to access the file
If you want to calculate it directly on the initital values:
=IF(OR(H2="Saturday", H2="Sunday", B2>18, B2<8), "NBH", "BH")
p.s. Alternatively you can combine the already calculated columns, if you intend to keep these columns:
=IF(AND((E2="BH"), (D2="BH")), "BH", "NBH")
I have two columns as shown below. Group values is 0,1,2,3,4 and scores is from 0 to 80. I want to count how many 0s (1s, 2s, 3s, 4s) are present for scores between 0 and 10; 10 and 20; 20 and 30 etc.
I am thinking to use Excel pivot table. But I am stuck - how could I achieve this?
Group scores
1 8.56163
2 34.3649
2 12.2291
0 8.75357
2 8.75967
2 5.87806
0 9.33751
2 32.0303
0 43.5567
2 11.1044
2 24.9266
1 18.9314
-------- result should look like below --------
scores group count
0-10 0 2
0-10 1 1
0-10 2 2
0-10 3 0
0-10 4 0
10-20 0 0
10-20 1 1
10-20 2 2
...
------ PS I have solved this problem using matlab. But it would be nice to see someone do it in Excel.
---------------- thanks for all the anwers. I really appreciate it. I have accepted the 1st answer.
I apologize for my previous answer. You can do binning with PivotTable.
select your whole two columns (A1:B13), insert PivotTable
under rows, put your "Group"
under columns, put your "scores"
under values, put your "Group"
click that last one ("Group" within the values quadrant) and change it to count, not sum
intermediate result:
Now in the resulting pivot table, right click on a colum and select "Group and show detail". You can configure your bins there.
Result:
One option is to use a pivot table, but another option is to use COUNTIFS, e.g.:
=COUNTIFS($A$2:$A$13,"="&$F2,$B$2:$B$13,">="&D2,$B$2:$B$13,"<="&E2)
In practice:
You could just use simple countif formulas:
Type out first criteria into cells. D1 = 0, E1 = 1, F1 = 2 etc.
Now you can just say =COUNTIF($A$2:$A$13,D1) and just drag that out.
The other column would require countifs.
Lets say D3 is blank E3 = ">10", F3 = ">20", etc.
Now D4 = "<=10", E4 = "<=20", F4 = "<=30", etc.
Now you can use =COUNTIF($B$2:$B$13,D4) for your first criteria and =COUNTIFS($B$2:$B$13,E4,$B$2:$B$13,E3) for the next criteria and just drag that out.
Hope this helps, good luck!
Please try:
This uses Grouping (by decade) for the Row labels.
To Group, right-click on one of the entries under Row Labels and Group..., then select enter Starting at:, Ending at: and By: to suit:
Hoping someone can help,
I work for a fire department and i am trying to determine the number of times all our rigs on the road at emergencies at the same time. I have all the data from date, times, etc... So what i am looking for is an excel summation total that would display the sum of overlapping times that were greater than 3. So kinda as follows:
Rig Date Start Time End Time
1 1/1/2015 0703 0759
2 1/1/2015 0705 0823
3 1/1/2015 0706 0815
4 1/1/2015 0723 0759
1 1/1/2015 0802 0845
With more than three rigs on the road after 0723 it would grant me a total of one but then at 0802 rig 1 goes back out again meaning my total would increase by 2 and so on and so on. I dont have the slightest clue as to how to program this. I have three years of data i need to crunch through and something like this would help me greatly. Any help whatsoever is appreciated. Thanks in advance and lets see what you all come up with!
First, you might want to convert the times to Excel date-times (assuming you already applied Format as Table to your data, so all new formulas get populated for all rows automatically):
if the values are already Excel times, use:
=$B2 + C2
if you have integers like "703" (formatted as "0703"), use:
=$B2 + INT(C2/100)/24 + MOD(C2, 100)/24/60
or if you have values-as-text:
=$B2 + LEFT(C2, 2)/24 + RIGHT(C2, 2)/24/60
Don't forget to format the new columns using Custom Number format d.m. hh:ss or m/d hh:ss.
The next step is to count all ongoing deployments that end only after the current deployment started, i.e. use following formula as illustrated on screenshot:
=COUNTIFS(F$2:F2, ">" & E2)
Please make sure that the formula e.g. in row 13 looks like =COUNTIFS(F$2:F13, ">" & E13) to check that you are on the right track. Also none of the values can be 5 or more if you only have 4 rigs, otherwise you have an error in your data.
And to count number of times when all 4 rigs were in use, the formula looks like this:
=COUNTIFS($G$2:$G$13, 4)
In case you also want to sum the time while none rigs were available, add 2 more columns in your table. Column H in my illustration needs following array formula (entered by Ctrl+Shift+Enter):
=IF(G2=4, MIN(IF(F$2:F2 > E2, F$2:F2)), "")
And a normal formula in column I:
=IF(G2=4, H2-E2, "")
Don't forget to format numbers accordingly.
And do a simple sum: =SUM($I$2:$I$13).