I am using a pivot table to count the number of loans that a certain state has in a certain category. For example:
Label Count
Arizona 50
Payment on time 25
Payment delayed one month 15
Payment delayed two months or more 5
This means that Arizona has 50 loans, from which 25 are on time, 15 have a slight delay and 5 have a serious delay. Unfortunately, there are certain states that have no loans in a given category and I would like the pivot table to display a zero in one such case.
For example, I would like to go from this:
Label Count
Texas 50
Payment on time 45
Payment delayed one month 5
To this:
Label Count
Texas 50
Payment on time 45
Payment delayed one month 5
Payment delayed two months or more 0
In essence, I want every state to display all three categories: On time, 1 month delay and 2+ months delayed. Even if they have no loans in either one of those categories.
Thanks in advance!
I apologize for posting something with such an easy fix. Here's how I managed it.
I went into the fields popup window and selected:
Rows -> Field settings -> Design and Layout -> Show items with no data
The pivot table now display all three categories for every state.
Thanks for your help anyway.
Related
I have a PowerPivot table that gives me the information about the daily amount a company gives for food to its employees. Per example, a company gives 130$ to the employee which is the same to say (130/22 days)= 5,91$ daily.
This is the simple explanation.
The PowerPivot has 4 scenarios 19 days, 20 days, 21 days and 22 days (The possible weekdays per month in a year).
Now, I already have a measure with the MOD of each day.
"In 19 days the most recurring value is 5,91$, for this company"
What I need your help with is calculating how many times that 5,91$ appears in the table.
I already built something through pivottables and using COuntifs. That basically go through the pivottable searching for the value. But the file is heavy, really heavy.
I'll leave you an example and the answer:
Hope its clear for all and thank you
I have the above sales order data which lists a day by day update of orders as they go through each stage until shipped. Orders 1 and 2 are shown alongside the status of that order for each date between 1st and 08th February.
What I need to do (in a pivot eventually), is to count the number of days for each order that they were in each state. So for example Sales number 1 was in a processing state for 4 days and a packed state for 3 days and then finally a shipped state for 1 day. I want these 3 numbers displayed beside each status maybe on a separate line?
For example
Sales Number 1
Processing - 4 Days
Packed - 3 Days
Shipped - 1 Day
You'll also notice that on Sales Number 2, the order went back into a "On Hold" state, this can occur in my dataset so just count it as normal e.g On Hold - 2 days.
How would I get this count using a formula or pivot etc?
Simplest way is to use pivot table:
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))
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.
I'm trying to create an average by category in a pivot table. This is the first time I've created a pivot table so sorry if the answer is staring me in the face. My raw data looks like:
Date, Transaction type, Description, Paid out, Paid in, Balance, Category
Mar-13, Visa, SHOP, £4.44, , £X, Gifts
Mar-13, Visa, SHOP, £5.00, , £Y, Children
Mar-13, Visa, SHOP, £6.00, , £Z, Gifts
Mar-13, Visa, CLOTHES SHOP YORK, £8.00, , £A, Clothing
Mar-13, Visa, FOOD SHOP, £11.96, , £B, Food
My pivot table shows the information rolled up by Month and grouped by a category:
Row Labels Sum of Paid out Sum of Paid in Sum of Difference
2013
Jan £Jan £Jan £C
Food 1 2 -
Car 2 3 -
Cash 6 6
Feb £Feb £Feb £D
Food 1 2
Car 8 0
Cash 2 3
The categories/data is made up in this case, but the desired outcome I'm after is to get an annual average, informing me how much comes in/out on average across the year per category... looking something like:
Row Labels Sum of Paid out Sum of Paid in Sum of Difference
2013
Avg £AvgIn £AvgOut £AvgDiff
Food 1 2 -
Car 5 1.5 -
Cash 4 4.5
Jan £Jan £Jan £C
Food 1 2 -
Car 2 3 -
Cash 6 6
Feb £Feb £Feb £D
Food 1 2
Car 8 0
Cash 2 3
Is this possible to achieve using a pivot table, as I can't seem to find a way to this at the moment using Excel 2010.
Since it appears that your raw data is already grouped by month, you're able to do this pretty easily. You need to re-arrange your data, however -- the months and the categories need to be on different axes. For example, Category as ColumnLabels, with Values then Month as Row Labels. Then right-click one of the normal values for Paid Out, choose "Summarize Value As...", you'll see SUM is currently checked, just change to AVERAGE. Repeat for one of the Paid In values. The labels should change to help let you know if it worked.
Note that this will NOT work effectively if your source data comes in daily, for example. With only one entry per month, the SUM and the AVERAGE of the single entry are identical. This would not be the case if your raw data was daily (and you still grouped by month) -- you'd be switching from a monthly total to a daily average.
I am currently using LibreOffice, which is just the free version of Excel on a mac. It is basically the same thing, but anyways, do you see the top bar where it says =AVERAGE(B8,C8,D8)? Well, that is how you can incorporate the functions within the table. This is actually a pivot table I had to do for my Java class. All you have to do is click on the cell you want to edit, type =, the function name, (in your case, AVERAGE should be fine) and then any other kinds of functions you use. Hope this helps you out.