SUM UNIQUE except...? - excel

Okay, this may get confusing, but I'll do my best to describe it.
I'm trying to calculate the amount of days a task takes to complete. So I have a spreadsheet that lists the tasks, assigns hours, and assigns a person to do that task.
So, say Task 1 has 5 sub-tasks, and each take 8 hours. If I assign Bill to each task, Bill will take 5 days to complete Task 1. That's easy.
Now, if it takes Bill 5 days to complete Task 1, but the deadline is in 4 days, I simply take 1 of the sub-tasks from Bill and assign to Bob, and viola... we now have 40 hours of work being done in 4 days.
I have all this working with the following formula:
=MAX(SUMIFS('Task List'!Q:Q,'Task List'!T:T,UNIQUE('Task List'!T:T),'Task List'!D:D,"<>"&"*Summary"))
The formula looks down column T and finds any UNIQUE names. It then basically puts those hours happening at the same time as the other hours (from column Q) since Bill and Bob can work at the same time. Another way to look at it is: the person with the most tasks assigned to them is controlling the end date, since that's the "longest" everything will take to get done.
Now the question...
There will ALWAYS be a task at the end of each project called "baking". "Baking" will always be in column H. Baking will always be assigned to a UNIQUE person not on the project... so Bill and Bob will be part of the team, but Baking will always be a different Unique person.
So what happens is the above formula is subtracting out the Baking line because it's a unique name.
But I don't want that. The Baking task will always happen after the other tasks are done and can't be done while Bill and Bob are doing their tasks.
So, what I need the formula to say is, "Look down Column T for any unique names and add the person's hours which appears the most, but ignore this if column G has "baking" in it, and always add these hours normally."
If it helps, the first image below should return the full Value of "80" because Bill is doing all the tasks and Baker is baking once Bill is done, so the total time for the project is 80 hours. However, the above formula returns "70", because "Baker" is Unique.
This one SHOULD return 70, because Bob took 10 hours from Bill's plate, but again, Baker happens after all tasks are done (Bill: 40+10+10 + Baker 10):

=SUMPRODUCT(--(E:E<>""),Q:Q)+MAX(SUMIFS(Q:Q,T:T,UNIQUE(T:T),F:F,"<>"&""))+SUMPRODUCT(--(G:G<>""),Q:Q)
This would do the trick as well. Looking for the time for gathering ingredients + max time of unique employees + time for baking.

Answered in the other thread...
=MAX(SUMIFS(Q:Q,T:T,UNIQUE(T:T),D:D,"<>"&"*Summary",G:G,"<>Baking"))+SUMIFS(Q:Q,G:G,"Baking")

Related

Counting total duration of stay with multiple entries per customer

I have an excel file that has 2 spreadsheets. First spreadsheet ("masterlist") contains the masterlist with 4 columns:
CustomerID
Checkin
Checkout
Duration
1
9/1/2020
9/3/2020
A customer might have multiple entries as they could've checked in and out multiple times. There's thousands of records/rows overall.
The 2nd spreadsheet ("Infosheet") just has ONLY the unique customers from masterlist and is structured:
CustomerID
Total_Duration
1
My end goal is to calculate the total duration of each customer's stay.
For calculating Duration in "masterlist," I did a simple if statement formula:
=IF(checkout=checkin,1,checkout-checkin+1)
If statement, because if the checkin and checkout are on same day, the customer is still considered to have stayed 1 calendar day. The addition of 1 in the false case is done to account for the same full calendar day. So a stay of 9/1-9/3 should yield 3 days total.
Long story short, I ended up with a formula that reads the following for the "Infosheet"'s Total_Duration:
=SUMIF(masterlist!$A:$A,A2,masterlist!$D:$D)
Problem is that there's multiple assumptions made using my logic that ends up getting multiple records wrong.
If a customer has the following two records:
Checkin
Checkout
Duration
9/1/2020
9/3/2020
3
9/3/2020
9/5/2020
3
My formulas calculate the duration of stays for both as 3 days and in the "Infosheet" the total duration would show as 6 days. The correct result would have been 5 days, because we shouldn't be counting 9/3/2020 twice.
My formula also doesn't account for a case like the one below:
Checkin
Checkout
Duration
9/1/2020
9/3/2020
3
9/3/2020
9/3/2020
1
10/1/2020
10/3/2020
3
10/3/2020
10/3/2020
1
While the duration, in isolation, are calculated correctly, the SUMIF would give us a total duration of 8 days. In reality, the 9/3-9/3 and 10/3-10/3 stays have already been accounted for in the 9/1-9/3 and 10/1-10/3 stays so it shouldn't have been counted again and the total duration should've been 6 days.
I am completely stumped on what should be my next step. How do I account for these examples in my formula? How should I be manipulating the data/changing or adding columns to make this easier?
Thanks in advance!
we can use Sequence to create an array of days from the Min to the Max dates and use COUNTIFS to find if they fall inside the ranges.
=LET(
ID,A:A,
ckin,B:B,
ckot,C:C,
ids,F2,
mn,MINIFS(ckin,ID,ids),
mx,MAXIFS(ckot,ID,ids),
sq,SEQUENCE(mx-mn+1,,mn),
SUMPRODUCT(--(COUNTIFS(ckin,"<="&sq,ckot,">="&sq,ID,ids)>0))

How can I generate activity map for customer care executives?

I have data of customer care executives which tells about how many calls they have attend from one time another time continuously. I need to find out whether particular executive is either busy or free in a particular period. The timings for the office is 10:00 to 17:00, so I have sliced the time with one hour in each slice from 10:00 to 17:00.
The data that I have would look like as:
Note:
The data given here is some part of original data and we have 20 executives and they have 5 to 10 rows of data. For simplification we have used 3 executives with less than 5 rows for each one.
The start timings do not follow any ascending or descending order
Please suggest the formulas with out any sorting and filtering on the given data
Required: The result table should give whether particular executive is busy or free in every hour. If he is on call for one minute it should give busy for that entire one hour period
The result should be like:
The same file is attached here:
Thanks In Advance!!!
You need to put in an extra logical test in your OR function that tests for start times less than the time interval start and end times greater than the time interval end. So in cell G31 your formula should read:
=IF(OR(COUNTIFS($A$3:$A$14,A31,$C$3:$C$14,">0",$D$3:$D$14,">=14:00",$D$3:$D$14,"<15:00"),COUNTIFS($A$3:$A$14,A31,C$3:$C$14,">0",$E$3:$E$14,">=14:00",$E$3:$E$14,"<15:00"),COUNTIFS($A$3:$A$14,A31,C$3:$C$14,">0",$D$3:$D$14,"<14:00",$E$3:$E$14,">=15:00")),"Busy","Free")

Excel Formula for calculating time in round numbers with hours text

I'm trying to figure out a way to create an excel spreadsheet that will allow me to keep track of how many hours I've earned per each paid holiday my company offers, then keep track of how many hours I've used and what's remaining. But I'm unsure how to calculate this properly.
I could easily do the math my self as it's a simple lay out, but I'm trying to find a way that will just let me enter the numbers for earned and used and walk away from anything else.
What I'm trying to do is the follow:
Have multiple sections. In the first section it'll be my holidays. So in like Column A, working down I'd have New Years, Memorial Day, July 4th, etc. Column B working down would be time earned. But this would be labeled in each cell as "8 Hrs" or "4 hrs". Column C would be time used in the same format "4 hrs" "8 hrs". Then Column D would simple be hours remaining.
Now in the second section I'd have holiday hours earned, which is 2 weeks. Not too sure how to lay it out, and then I still have my sick days, but not sure if I should include that in section 2 or not with the vacation time.
I'd like a way to be able to simply Calculate B2 - C2 = D2. So 8 Hrs - 4 Hrs = 4 Hrs (to show 4 Hrs remaining for each line item.)
Problem is I'm unsure how to calculate remaining time simply because of the Hrs suffix. And with that I also can't calculate total time still remaining, both for holiday hours earn and vacation/sick hours.
Yes, it's easier for me to track it as 8 Hrs rather than 1 day, etc.
Any advice on how to formulate this. Or if anyone knows of a premade template that fits this type of scenario, that I could then just take and integrate into my own spreadsheet.
Sorry if this is confusing in any way.
Also, As I'm no excel wizard, unsure if this is relevant or not, but I'm using Excel 2016, as part of the Office suite.
Another option is to just leave the number as it is and label the column accordingly. Do you really need to see "hrs" in every cell when you know you are tracking hours?
Use a custom number format of,
[>1]0 \H\r\s;[=1]0 \H\r_);0 \H\r\s;[Red]#
... and treat all hours as integers.

Solr rangesearch within strings containing chains of characters

I hope I find some Help. I'm pretty new to solr and had the oportunity to participate to a talk about it.
For the following scenario even the consultant, who held the talk was unsure about, therefore I hope someone had the same problem.
I have a list of objects identified by a specific key. For examplepurpose:
There are 500000 employees identified by id's (1-500000). Everyone of these people has to work for the next 2 years. Every day of these Years is identified by a character (employee will work - "A", employee won't be at work - "B"). So every employee got a String containing up to 730, but not every employee has the full amount of 730 characters (a specific employee joined the company later or something).
Example String for employee 256:
AABBAAABAAAABBAB
=> Employee 256 will work 2 days, 1 day he is not working, then he will work 3 days in a row, 1 day freetime, 4 days work, 2 days not at work, 1 day work, 1 day home and so on.
Example String for employee 542:
ABBAABABAAABAAAABABBAABAAAAABBABBABABBBABAABABBABABABBABAAAA
Example String for employee 2:
AAAABABBABABAAAABABABABABA
For dispositionpurposes I now want to get the employees who are 4 days in a row at work to go to dinner with them or whatever.
I want to receive the following results:
employee 256 4 days free after day 8
employee 542 4 days free after day 12, after day 23, after day 56
employee 2 4 days free after day 0, after day 12
I hope you got my problem. The example is only for a better imagination. Is it possible to implement a solution with solr?
Other solution approaches (also for the day representation) are highly welcome. Right now we are dependent on the daily representation (every day has one character). But if you deliver me a high performance solution even this is discussable. The amount of entries (500000) is realisitic for the project.
I would not model this as employees, but as availability. Perhaps with availability as a nested/child object of an employee. And availability object would then be StartDay,NumberOfDays.
The query then becomes a simpler join with condition on the child being NumberOfDays>=4.

Trying to calculate tasks in Excel

I was going to ask my question over at that "Experts" place, but they wanted me to pay $12.95! Fo that price I could pay some college wiz kid to do this for me, and have it done quicker!
Ok, this should be an easy one, but for some reason my brain is freezing up when I try to do it.
I have a spreadsheet with three sheets in it. The first has the tasks completed in it:
Created Time CreatedUserName ServiceDetailName BillingCnt
7/1/2010 6:25:17 AM Employee Name Tape Management 30
7/1/2010 8:15:33 AM Employee Name Information Request Detailed 1
7/1/2010 8:18:24 AM Employee Name Hard drive 1
7/1/2010 8:25:42 AM Employee Name Information Request Brief 2
7/1/2010 10:33:17 AM Employee Name Scratch Tape Count 2
7/1/2010 2:07:59 PM Employee Name Hard drive 1
7/1/2010 2:18:36 PM Employee Name I/O module 1
The next 2 pages have information regarding the value of each task as well as internal descriptions:
Task Type Task Detail Task Description Unit of Measure (in Minutes)
INC Hard Drive Swap Drive 60
MAC Tapes Managment Change Tapes 1
There are about 30 tasks per page. I want to somehow take the billing count from page one and multiply it by the unit of measure. Then I have a cell set up where I want the total displayed in total minutes then another cell where it is in hours and minutes.
I have a sample spreadsheet but I can't see any place to attach it.
hmm ... not really a very normalized design ... I would expect that at least one column in sheet 1 should match one column in sheet 2
Either introduce Task Type in sheet 1 or match [Sheet1].ServiceDetailName with [Sheet2].TaskDetail - that's the closest match I could find, though in [1] you write "Tape Management" whereas in [2] you write "Tapes Management". As long as the input data stays that way the best is to give it to an assistant ;-)
so here's my suggestion:
one master table of task types (like your [2])
create a named range across [2].TaskDetails (except header) and use this range as cell validation in [1].ServiceDetailName. Don't allow manual input
create another named range across [2].TaskDetails expanded to include column "UOM"
in [1] use a =VLOOKUP() function to match the UOM into the detail table
in a further column multiply BillingCnt times UOM to get minutes
to display minutes in hh:mm in the next column you divide minutes by 1440 (60*24) to get "fraction of day" and format it with custom string "[h]:mm"
Hope that helps
Good luck - MikeD
-

Resources