How to copy field in PivotTable - excel

I want to copy a field in the PivotTable summary area. Below is my PivotTable:
Group_Age Sum of attrition_flag Count of acct_id Max of age
1 73 661 27
2 65 663 37
3 54 779 57
4 32 467 59
5 40 725 62
Now if I also want to add Min of age, how do I do that?
Currently I am trying to copy and paste field "Max of age" in the summary area and change the field settings, but I am unable to copy and paste.

Just drag the Age field into Σ VALUES a second time and for this "Summarize value field by" Min.

Related

Excel: How to Use AVERAGEIFS with Multiple Ranges (different columns)

Date
Group A
Group B
Group C
Group A
Sub Group
A1
B1
C1
A2
1/1/2022
35
12
54
10
1/2/2022
43
45
62
93
1/3/2022
76
65
39
48
1/4/2022
12
25
81
18
1/5/2022
89
76
20
26
1/6/2022
23
87
47
17
1/7/2022
56
59
21
53
1/8/2022
29
51
9
68
1/9/2022
76
8
52
35
1/10/2022
36
53
38
53
User Input
Start Dt - 1/1/2022
End Dt - 1/5/2022
Group - Group B
Question
What is the daily average of a Group given the above user input?
Formula
=AVERAGEIFS(INDEX($B$2:$E$11,,MATCH($I$3,$B$1:$E$1,0)), $A$2:$A$11, ">="&$G$3, $A$2:$A$11, "<="&$H$3)
Answer
44.6
User will select a start date, end date and Group.
I want to compute the daily average of that.
The issue arises when there are multiple columns with same group as Averageif takes the first column only.
Issue - How can I find the daily average of Group A for the given dates, given that Group A are in two columns (they can't be combined as there are multiple sub groups)
If you are on Microsoft-365 then can try-
=AVERAGE(FILTER(FILTER(B3:E12,B1:E1=I2),(A3:A12>=H1)*(A3:A12<=H2)))
If you have an older version you could use:
=AVERAGE(
INDEX(A1:E12,
AGGREGATE(15,6,ROW(A3:A12)/(A3:A12>=G3)/(A3:A12<=H3),
ROW(A1:INDEX(A:A,SUMPRODUCT((A3:A12>=G3)*(A3:A12<=H3))))),
AGGREGATE(15,6,COLUMN(B1:E1)/(B1:E1=I3),
TRANSPOSE(ROW(A1:INDEX(A:A,SUMPRODUCT(N(B1:E1=I3))))))))
Entered with ctrl+shift+enter (I think)
In the picture below J3 shows the answer cell. K3 is used to demonstrate the array that is used for the AVERAGE function (a Office 365 spill range).
Another old school approach. User input fields in the formula are referenced using named ranges.
=SUMPRODUCT(($A$3:$A$12>=StartDt)*($A$3:$A$12<=EndDt)
*($B1:$E$1=Group)*($B$3:$E$12))/(COUNTIFS($A$3:$A$12,">="&StartDt,$A$3:$A$12,"<="&EndDt)
*(COUNTIF($B$1:$E$1,Group)))

Sum column in Excel from 1 value in a separate column until a different value in the criteria

I am trying to sum a column A based on a value in column B, but I only want to sum the values until I reach a different criteria value (in column B). When I reach that value, I want to reset the function & repeat.
A
B
Sum Value I'm looking for
12
N/A
12
34
N/A
46
21
N/A
67
45
BREAK
109
232
N/A
232
64
N/A
296
231
BREAK
527
423
BREAK
423
46
N/A
46
4
N/A
50
56
N/A
106
86
N/A
192
235
N/A
427
463
BREAK
890
3
N/A
3
57
N/A
60
75
BREAK
135
I have tried SUMIF but cannot get this to work. Any help would be greatly appreciated.
Thank you!
The following formula should work:
=SUM(A$2:A2)-SUMIF(B$1:B1,"BREAK",C$1:C1)
And populate down
I've started using this formula (in cell C2):
=IF(B2="BREAK";A3;C2+A3)
This is not entirely correct, but it gives another idea: in order to repeat the calculation of the whole sum, you do this in an cumulative manner (first you get A2+A3 (which you put in cell C2), then A2+A3+A4 (which you put in cell C3), ...).

Find out minimum value of specific columns in a row in MS Excel

My table in Excel looks something like this:
abcd 67 94 52 89 24
efgh 23 45 93 54 34
ijkl 64 83 23 45 92
mnop 34 45 10 66 53
This is a student database containing marks obtained in various subjects. I need to calculate the percentage in each row such that out of 5 subjects, the first subject is always included with other 3 subject with maximum marks.
Example: abcd 67 94 52 89 24 75.5%
Here 75.5%=(67+94+52+89)/4=302/4=75.5 where 24 being the lowest has been excluded and 67 has to be taken even if it were the least.
What I require is the least(excluding the first column, of course) of all the columns in that particular row, so that I can sum all the marks and subtract this least marks and finally use it to calculate the percentage.
Any help/suggestion would be appreciated. Thank You.
You'll need to adjust this for your columns, but if you sum the entire range, then subtract the min value after, do a count of the range then subtract one from that, you will be able to get the average.
This code is using the 4 values from column B through F and the 4 values are: 67 94 52 89 24... which results in 75.5
=(SUM(B3:F3)-MIN(C3:F3))/(COUNT(B3:F3)-1)

Excel - Show summarised counts of average, min and max value from range of data

I have 2 sets of data, set 1 is a list of accounts and a count of items for each account from set 2. Set 2 data is a breakdown of the values for each account.
The examples below are representative of the data I'm working with, and there are 1000's of records so I'm after a formulaic way of doing this.
Set 1
Account Count
123 3
128 2
135 4
157 5
...
Set 2
Account Value
123 11
123 31
123 98
128 77
128 99
...
What I'd like to do, is show a set of data containing the average of the values for each account and the min and max value.
For example:
Output
Account Count Average Min Max
123 3 47 11 98
128 2 88 77 99
...
Ignore the first set and merely use Set 2 as a basis for a pivot table.
Then drag the column Value four times into the Value box and summarize by Count, Average, Min, and Max.

Compare column A with column B and return minimum value in column A in Column C

Here is my table. I want to return the minimum value from column A in column C only if the values in Column B are equal.
A B C
1 Price Category Lowest Price Per Category
2 240 19
3 231 19 231
4 233 19
5 450 12
6 438 12
7 425 12 425
8 674 33
9 675 33
10 671 33 671
You could try the SUBTOTALfunction and use this formula in the column for lowest:
=IF(A2=SUBTOTAL(5;$A$2:$A$4);A2;"")
You would have to manually adjust the locked range ($A$2:$A$4) for every group though so that it matches the range for the group.
Or if your happy with getting the min value for each group on a separate row under every group you could just mark the two columns (including header row) and use the Subtotalbutton on the Data tab set like in this image:
Then the result would look something like this:
Price Category
240 19
231 19
233 19
231 19 Min
450 12
438 12
425 12
425 12 Min
674 33
675 33
671 33
671 33 Min
231 Grand Min
Try using this formula in C2 copied down
=IF(COUNTIFS(B:B,B2,A:A,"<"&A2),"",A2)
COUNTIFS here counts rows where the category matches and the price is lower than the current row. If there is no such row then the current row price must be lowest for that category and the price is returned.
If there are tied lowest prices within any category then they will all be shown

Resources