Trying to calculate tasks in Excel - 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
-

Related

How do I set a value limit to a specific cell in Excel and add exceding entries to another cell?

Over the past couple of days, I've had a hard time figuring out an issue that is supposed to be easy but I just can't wrap my head around.
To add some context, here's what I'm trying to do: I'm working on a class attendance sheet for teachers to keep track of students' attendance. In order to submit an entry, teachers will have to fill in 4 different cells: Date, Time, Lesson Content and Status (whether the class took place or the student didn't show up). I've added a dropdown to the Status cell so that the teacher chooses between predetermined codes (more on that soon).
I've also included a separate sheet where the school will register eventual replacement classes set up in alternative schedules, and it works in a similar fashion to the overall attendance sheet.
The third and last sheet in this workbook (where I'm having some issues) is an Hour Bank that is calculated based on the amount of cancellations versus the replacement classes the student scheduled and attended.
Here's where the issue kicks in. As I mentioned, I would like to create an Hour Bank System in order to store the classes that are "replaceable". This would be a relatively simple task, the only issue is that I also need to establish a cap (which is 8) so that the Hour Bank will not add beyond this specific number. The Hour Bank works fine, but the number doesn't go down immediately if the student exceeds the cap. If the student has, for instance, 2 classes over the cap, the Hour Bank Balance only goes down to 7 if I enter two replacement classes. However, I would like this particular cell to cap at 8 and go down as soon as a replacement class is registered, regardless of how many hours the student exceeds this cap.
Here are the elements contained in the 3rd sheet:
-Total Classes Given (D8): This part works fine. It's just a SUMIF with the specific code that means "Class ok". Code below:
=SUMIF(FREQ!F9:F106;"AR";FREQ!G9:G106)
-Total Client Cancellations (D11): This part also works fine. It's another SUMIF with the specific code meaning that the student didn't show up to class and didn't notify the school. These classes won't be accounted for in the hour bank. Code below:
=SUMIF(FREQ!F9:F106;"AC (Aluno)";FREQ!G9:G106)
-Total Replaceable Classes (D14): This part works fine. It's a combination of two SUMIFs with the codes that mean "Ok, student didn't come but we'll let them schedule a replacement class". Code below:
=SUMIF(FREQ!F9:F106;"PP";FREQ!G12:G109) + SUMIF(FREQ!F9:F106;"AC (Miles)";FREQ!G12:G109)
-Attendance Rate (D17): This part also works fine. It just shows the percentage of the classes that the student has attended up until the present moment. Code below:
=IF(D8>0; D8/FREQ!G107; "0,00%")
-Pending Replacement Classes (G8): This part works fine. It is a simple subtraction that calculates how many classes are pending (not considering the cap). This number goes down as I enter replacement classes in the second sheet of the workbook, and goes up as the teacher registers replaceable cancellations in the first sheet. Code below:
=D14-G11
-Given Replacement Classes (G11): This part works fine. It is a SUMIF that keeps track of how many replacement classes were given in total. Code:
=SUMIF(REPO!F9:F106;"AR";REPO!G9:G106)
-Exceding Hours (G14): This cell is broken. I'd like it to compute the amount of hours that the student has cancelled over the established cap. It does work when it comes to only computing the hours over the cap, but the issue is that it decreases as I enter replacement classes in the 2nd sheet of the workbook instead of subtracting them from the Hour Bank Balance which I will explain below.
=IF(G17=8; G8-8; 0)
-Hour Bank Balance (G17): This cell is broken, and it's the most important part of the entire workbook. I would like it to compute the replaceable classes up until the cap (which is 8) and make it go down immediately as a replacement class is registered. However, if the student has Exceding Hours (G14), the replacement classes are substracted from G14 instead of G17, which is what I wanted. The Hour Bank Balance (G17) will only go down if the Exceding Hours (G14) equals zero. Here's the code:
=IF((D14-G11)>8; 8; D14-G11)
I hope I was clear enough and I'm willing to provide screenshots if need be. I'm sure there's a problem with my maths or something, but I've been unable to spot it.
Please help a brother out!
Thanks in advance
I think that this formula might be what you’re looking for:
=IF((D14 - G11) > 8, 8, IF(D14 > 8, 8, D14) - G11)
The first part of this formula would give 8 as a value if D14 - G11 is greater than 8; the second part of this formula yields D14 - G11 except for in cases where D14 is greater than 8, then it gives 8 - G11. Hopefully this is what you were looking for.

Efficiency question with excel using index match for each cell in a large sheet

I have a 4 types of customers, each pay in a different payment plan.
group 1 - monthly
group 2 - semi monthly
group 3 - bi weekly
group 4 - weekly
I have a sheet with a range of all the relevant payment dates for those group sorted in the right order in row 1
I would like that for each customer there will be a data validation list (group 1,group 2, group 3,group 4)
When selected the customer's row will populate on the correct dates according to his group number and the date the payment starts.
My work around to do that was to create 4 separate sheets for each group, auto populate from the correct date and run it for all customers in each group meaning you can see for John Doe what and when will be his payments in each group even though he is in group 3 for example. And a MAIN sheet where John Doe has group 3 selected where a MATCH and INDEX is running to find when he is supposed to pay and how much. The issue is that for 400 rows and 300 column this becomes heavy.
How would you go about solving that?
each cell looks like this in the MAIN sheet
=LET(mothlydate,Monthlyrd3!$BK$3:AAC$3,semidate,Monthlyth16!$BK$3:ZZ$3,namemonthly,Monthlyrd3!$BK79:AAC79,namesemi,Monthlyth16!$BK79:ZZ79,
IF(OR($BA96="Monthly 3 rd",$BA96="Semi-Monthly",$BA96="Monthly 16 th"),
IF((IF(IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")>$AE96,$AE96,IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")))=0,"",(IF(IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")>$AE96,$AE96,IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0)),"")+IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")))),
IF($BA96="Bi-Weekly 1",(IFERROR(INDEX(NewBiWeekly!$BK79:AAC79,1,MATCH(GH$2,NewBiWeekly!$BK$3:AAC$3,0)),"")),IF($BA96="Bi-Weekly 2",(IFERROR(INDEX(NewBiWeeklyTwo!$BK79:AAC79,1,MATCH(GH$2,NewBiWeeklyTwo!$BK$3:AAC$3,0)),"")),IF($BA96="Other",(IFERROR(INDEX(NewOther!$BK79:AAC79,1,MATCH(GH$2,NewOther!$BK$3:AAC$3,0)),""))))))
)
THANKS!!!
This is based on a purely textual analysis of your formula, since data required for a meaningful analysis hasn't been forthcoming:
the expression below occurs 4 times in your formula
IFERROR(INDEX(namesemi,1,MATCH(GH$2,semidate,0)),"")
as does this one
IFERROR(INDEX(namemonthly,1,MATCH(GH$2,mothlydate,0))
which means that, in the worst-case circumstances, one or both expressions are being evaluated on FOUR separate occasions - it would be sensible to consider making one or both of these named 'values' at the start of the LET() function, such that, in the worst-case cirumstances going forward, each would be evaluated only once.

Excel - Automatic allocation of preferences

Edit: Example file available here.
I'm not a super experienced Excel user, but I'm trying to automate using IF/AND/INDEX/MATCH to assign yes/no to preferences which competitively listed people have chosen from a list of about 300 choices. Each person has listed 4 preferences, there's over 1000 people in the process, and each person gets one preference out of four. A simplified hypothetical version of it is a situation where I want automate the allocation of employee shifts at a restaurant, with the employee data listed with the best workers at the top and the worst ones at the bottom.
Traditionally the Shift Allocation sheet has been done manually, which is fine when you have seven days of the week and maybe 30 employees. But if I have 300 days of the week and 1000 employees, I don't want to manually allocate each one to their preferences. Or if I do have a manual input, I want it to automate enough shift allocation beforehand so it doesn't take up as much time.
Ideally the automated formula to assign the yes/no indicator for the shift in the Shift Allocation would look at the first preference (day of the week) the person has listed in the Employee Data sheet, check the Shifts Available sheet to find the day of the week and then look at the number of shifts available in column K, if column K is more than 0, assign YES to that employee's preference on the Shift Allocation sheet, then move on to the next employee.
The employees are listed by who gets first pick, so in theory some people at the bottom may not get the shifts they preferenced, or there may need to be other manual changes made after the automatic allocation process for other reasons.
I tried VLOOKUP but the lookup logic wasn't broad enough, so I need something like an INDEX/MATCH parameter to find the shift places available in column K of the Shifts Available sheet after finding the day of the week in Column A.
This is about as far as I got with the code
=IF(AND(INDEX('Shifts Available'!$A$2:$K$8, MATCH('Employee Data'!$A$2,0)), 'Shifts Available'![K-column cell corresponding to the day of the week, unsure how to do this? Keep it in the INDEX?]) >=0)"Yes", "No")
Any help is appreciated.

Index Match Match across multiple columns

I have an Index Match Match question that I have not been able to find the answer for in researching. Although the solution may actually might be different than an Index Match Match formula - I'm open to try something more efficient than my current workaround.
I have one worksheet with data from my company on it. We sell a Product (let's call it Coke Zero) and we track the weeks that we put a promotion on and how much profit we make by selling it to the retailer. For example a promotion for Coke Zero starts the first week of Jan and ends 3 weeks later and we make a gross profit of $100 each week the promotion runs. I then have an external database with sales data formatted on a weekly basis to tell me how many units of Coke Zero I sold in each week. My internal data has thousands of lines like this with dozens of products, however the promotions are consolidated on one single row regardless of if it runs for more than one week, making matching up to the external database difficult. I need to create a lookup for what our Gross Profit was for each week of the promotion.
I have attached an example image of the workbook + two data sheets of what I've tried to do, summarised below.
On the Internal Data Sheet I've created additional columns to the right with all of the weeks listed that the promotion is on for, and concatenated them with the Product Code to be able to match week by week to the data in the External data sheet. Then my lookup basically checks every column one after another until it finds one where the concatenate of Week_Product Code concatenate matches.
My current solution technically works but my final formula is really slow and cumbersome given the data can be anywhere from 10K-200K lines when looking at multiple retailers. I was hoping to find a more efficient formula to complete the lookup.
Current solution on the External Data Sheet Column E:
=IF(ISNUMBER(MATCH(D2,'Internal Data'!$E:$E,0)),INDEX('Internal Data'!$D:$D,MATCH(D2,'Internal Data'!$E:$E,0)),
IF(ISNUMBER(MATCH(D2,'Internal Data'!$F:$F,0)),INDEX('Internal Data'!$D:$D,MATCH(D2,'Internal Data'!$F:$F,0)),
IF(ISNUMBER(MATCH(D2,'Internal Data'!$G:$G,0)),INDEX('Internal Data'!$D:$D,MATCH(D2,'Internal Data'!$G:$G,0)),
"0")))
I got SUMPRODUCT to work using this formula in J2:
=SUMPRODUCT(--($B$2:$D$3=H2)*--($E$2:$E$3=I2)*$F$2:$F$3)
And, you don't need those concatenated lookup columns:
Well, that was fun.

Attendance Calculations / Period Calendar

This is a multi-tiered project. Let me give a quick overview. I have attendance data, card/ timestamp punches. I would like to have a pivot table with slicers in Excel. Ideally you'd be able to choose a department / last name / associate number. And also a period of time. Ideally this would be a table with the company period/week. And maybe default to last weeks.
I can get at timecard data in two ways:
(1) generate a CSV that automatically performs the timecard math, to figure out how many hours someone worked and it is smart enough to understand 3rd shift workers. The format of that CSV is:
Last Name, First Name, Personnel Type, Associate Number, Facility, Department, TimeIn, TimeOut, Total Hours
The problem with this method is that I would have to manually append the information to the CSV tables. Or come up with some autoIT script.
(2) Get at the raw data via sql/odbc. This way the math is not done. It is just all of the associates timestamps. I would have to figure up the daily hours myself and figure out a 3rd shift formula too. It is not a set schedule, many people swing shifts and others get called in a lot.
Lastly, I would like to be able to filter the dates by using our company fiscal calendar. I have a spreadsheet that goes from 2000 to 2093. With everyday listed and it's corresponding year/period/week.
Example period info spreadsheet:
date Year Period week WeekTotal Period Total
12/3/2007 2008 1 1 2008.1.1 2008.1
12/4/2007 2008 1 1 2008.1.1 2008.1
I know there is a lot going on here, but what would be the best way to approach this project?
First I have not been able to post any script however the last I tried it I used two options 1. Was a php conversion where the time was numbers ( which makes it easier for calculations)
2. Was in the tables where I deliberately entered the values places the time in different columns or fields for hours, mins, and seconds this meant that while the input is eased I still have to calculate the output in php especially for totals, averages and differences.
Hope it helps a bit

Resources