Counting, filtering, conditioning command in Excel - excel

I am trying to solve this question. The question is:
A sport store target is to provide at least one employee per 10 customers and at least one administer officer per 10 customers. The store checks those figures running a report on the first Friday of the Month every 30 days.
I have added an example of the data. I am trying to identify the months during which the store failed to achieve those figures?
I would appreciate if anybody can help. please see the picture bellow.

=LET(data,FILTER(A:B,(A:A<>"")*(ROW(A:A)>1)),a,INDEX(data,,1),b,INDEX(data,,2),u,UNIQUE(a),x,--(TRANSPOSE(a)=u),mmlt1,CEILING(MMULT(x,--(b="customer")),10)/10,mmlt2,MMULT(x,--(b="SECURITY")),mmlt3,MMULT(x,--(b="administer officer")),FILTER(u,(mmlt3<mmlt1)+(mmlt3<mmlt2),"all correct"))
I took column A for WEEK_ENDING and B for ROLE
You can replace FILTER(A:B,(A:A<>"")*(ROW(A:A)>1)) with your actual data (without headers).
I than took the unique dates and calculated
the count of "customer` matching the date (mmlt1)
the count of SECURITY matching the date (mmlt2)
the count of administer officer matching the date (mmlt3)
I rounded up the customer count to the nearest 10 and then divided by 10.
Now either of the mmlt2 or mmlt3 values should be larger than the count of mmltq (round up & divided by 10) to meet the conditions.
Finally I filtered the unique dates to the conditions. The result spills the dates where either too little security was available per 10 customers, or too little administer officers.

Related

Excel: Count distinct numerical values if string condition matches

I have a list of employee names on one tab and another tab with orders shipped by employees and the month they were shipped going back 12 months. I'd like to calculate the average number of products shipped per employee per month, but I need to know how many months they were here to do that. So what I'd like to do is essentially write a formula that says give me the count of the distinct number of months they've been shipping products.
Sample employee data:
And here's the sample data on the individual shipments:
So in short, I need to know that Joe Smith shipped those 250 products across 3 distinct months to see he averages 83.3 shipments per month. Again, because there are many new people who have come onboard in the last 12 months, I can't just divide them all by 12 and need to know how many months they were shipping items in.
FILTER Shipper and Month based on Shipper column with criteria Employee name. Apply UNIQUE on filtered array to get only unique values (name + month number). Use COUNT to get active months. Divide Products Shipped by it.
Result:
Average by Count of Uniques
=LET(Shippers,B2:B11,Months,C2:C11,uShippers,E2:E4,uProducts,F2:F4,
uMonths,BYROW(uShippers,LAMBDA(uShipper,
ROWS(UNIQUE(FILTER(Months,Shippers=uShipper))))),
IFERROR(uProducts/uMonths,""))
You can use this array version, which spills all the results at once:
=LET(empl, A2:A4, prods, B2:B4, shipper, B7:B16, months, C7:C16,
ux, MAP(empl, LAMBDA(e, COUNT(UNIQUE(FILTER(months, shipper=e))))), prods/ux)
Here is the output:
It is also possible not using MAP but it is a verbose solution:
=LET(empl, A2:A4, prods, B2:B4, shipper, B7:B16, months, C7:C16,
left, TRANSPOSE(N(shipper=TOROW(empl))), right, N(months=TOROW(UNIQUE(months))),
cnts, N(MMULT(left, right)>0), ux, MMULT(cnts, SEQUENCE(ROWS(cnts),,1,0)), prods/ux)
Replacing TOROW with TRANSPOSE it should work for older Excel versions.
This is how I would have done it, create a Pivot table(Insert->Pivot Table) with Months as column, Employee as row and the values as count of shipments. Once you have the Pivot table, your life becomes easier. Now you do a count of the employee row (COUNT(COL-1:COL-X)) to count the total months a particular employee showed up.You now have count of shipments and a count of months. You can calculate the average. Not sure I can think of anything else easier.

How to Subtract a value from the oldest expiration date and move to the next once it hits zero?

I work for an organization and I am working on a way to better organize our part numbers that have expiration dates. I've started off by making an Excel sheet that has the part number multiple times based on the expiration date and then had the matching quantities of that expiration date. What im trying to do is what you always do in life, if something is going to go bad use up the one that will expire first. But now trying to do this in an excel table automatically. This is my Ex: my master log where they will put in the Part#, expiration date, and quantity, this is where most info will be pulled from.
I am now on to taking away our companies forecasted usage of these parts away from these quantities to show an overall usage over the months and pairing the intersecting expiration dates. I’ve got the Usage by using a pivot table to total these part numbers quantities. And I’ve made a chart mapping the overall usage to part quantity forecast with it being flagged if the expiration date interferes with the actual date. This is the forcasting for what we plan to use of each part #
This is me subtracting the usage number from the inventory of those part numbers and it being flagged when it expires.
=IF((IF((VLOOKUP($F60,Expires!$1:$1048576, 10, FALSE))<Sheet1!G$58, "Bad", "Good"))="good", T33, "Expired")
I used this function, my vlookup pulling from my first sheet and pulling the part numbers expiration date and if it is <the date up top (9/1,10/1 etc.) then it will be flagged as expired and wont even show the usage. T33 is simply pulling the fromual from another table which is just quantity- usage. Please lmk if this looks right my vlookup turns out pulls the latest expiration date from the multiple part #s.
But that is with total quantities, not separated based on the part number expiration dates. What I am wondering is how can I make a table like this but subtracts the usage from quantity of the part number that will expire first? Then after that quantity hits zero it takes away the usage from the next one due to expire? But also I want the Numbers to be able to auto populate from the sheet where the user enters the data (master log).
So this is what it will be doing and will look like the table above multiple of the same part number. Whats happening now
But needs to look like this Final table and add the part number to the list and quantity as they are entered in the master log. I was trying to do a Vlookup(MIN and take the part number from the other table based on the lowest expiration date first but I don’t think excel is capable of that, I’m not sure here.
Please help, thank you!

Assign specific dates based to an employee level dataset on weighted averages in excel

I have a dataset in excel which shows headcount by employee level and which department each employee would fall under (sales, ops, or support). I would like to send a survey to each employee once every 26 weeks (2 times a year), but I would also like to keep sending surveys every week to ensure continuation of surveys to a certain amount of population split between sales, ops, and support departments based on their weight of the total population.
This way, I am sending surveys every week to a tiny bit of my overall headcount but only repeating people every 26 weeks.
Can anyone please help on how to solve this in excel with a formula?
From attached sample data, how can I split the headcount to send surverys for 26 weeks straight but to different population every week and not repeat? This different population should be split by % of department out of total headcount. Meaning if I have 10 people every week and % split is 40% sales, 30% operations, and 20% support, the survey should be sent to 4 sales, 3 operations, and 2 support people. Please note that the 10 people and the %s may vary every week because of new hires and resignations.
Thank you!
Sample Data
In the data sheet, ceate a helper column D, where you hand out the numbers to each employee, label it MOD. Use the formula for each employee, enter to cell D2:
=MOD(ROWS(A$2:A2)-1;$H$2)+1
That way each employee is assign a number from 1 to whatever is in the cell H2, e.g. 26. Then contact list all employees with 1 and you have the first batch and so you continue each week to get to employees with 26 in 26 weeks. This way all get the survey but just once.
Of course the share of the individual depts cannot be achieved each time, as there are less employees in some. If you wanted to keeps the shares, some employees of the smaller departments would get the survey more times.
If you want to get some randomness into the order, just mix the order of MOD numbers, e.g. start with 7, continue with 23 etc.
I hope I got the question right, I am not sure in some parts.

Count of customers scheduling service dates in consecutive years

I am brand new to Spotfire (using 7.7) and am hitting a roadblock on a simple task so am hoping for some assistance.
I need a count of customers that are scheduling service dates in consecutive years.
Since users will be using different date filters I created a MaxServiceDate calculated column to give me the max date depending on the filter and from there subtract a year to give me a PreviousYear calculated column.
Then my thought is then do a distinct count of all CustomerIDs which have a ServiceDate that match the MaxServiceDate and PreviousYear. The issue I'm running into is I don't know how to group by or fix the CustomerID in order to loop through the ServiceDates and check if they have dates matching my criteria.
Thanks for any help.
Sample data:
You can create a secondary table with a pivot transformation having the max(ServiceDate) and customer ID. The join that table back with your original so that you have the maxdate for each customer on your main table. Then do a calculated column based on the Max(ServiceDate) and Service date to determine if > 365 days.
Pivot Transformation
I think a calculated column like the following would meet your needs:
If((Max(Year([ServiceDate])) over (Intersect([CustomerID])) - Min(Year([ServiceDate])) over (Intersect([CustomerID])) + 1)=UniqueCount(Year([ServiceDate])) over (Intersect([CustomerID])),"good","bad")
For each customer, take their max service date year and subtract their min service date year and add +1. This number should match the number of distinct years associated to that customer's service dates.
This will tell you if a particular customer (at least while you had that customer) had service done in consecutive years or not.

Excel - What is the best way to analyse the following data?

I'm looking for the best way to analyse the following data.
This is the amount in hours an employee has taken in a year and what remains. The data bars are a percent of hours taken from what they're allotted, shown in column K. Col I is how many hours they have left, and col J shows the cumulative holiday they've taken throughout the year.
I need the relevant info shown on one row where each row will be an employee's holiday history. Different employees have different hours and I need a way that shows who is in most need of taking holiday when that filtering from largest to smallest etc.
Where I find this tricky is if an employee had 10 hours allotted, and has taken 2 hours, that's 20%, which is the same if someone had 100 hours and has only taken 20 hours. But it's clearly more important that the second employee uses up some of their leave. I'm struggling with the best way to represent this.

Resources