Percentage Greater than/Less than in a table - excel

I have a table that I want to find the percentage greater than and percentage less than compared to a baseline, for the total group based on the weights of each group.
Here is my example table:
Benchmark GRP 1 GRP 2 GRP 3 GRP 4
10 10 11 10 12
14 12 15 11 15
17 11 17 13 16
18 14 15 14 17
Poulation 40 45 30 80
What I want to do is find out for each level of the benchmark what % of the total population of all four groups is above or below the bench mark value.
I have tried various sumproducts and sumifs but can't seem to get it work.
Let me know your thoughts!
Thanks as always!

Assuming your sample data is in A1:E7 put the following formula into B9 and use Ctrl+Shift+Enter to record it as an array formula:
=SUM(IF(B$2:B$5>$A$2:$A$5,1,0))/COUNTA($A$2:$A$5)
This can then be copied across under the other groups. Below is showing how it works for me.
Note: The array formula will display with braces ({...}) around it but you do not type these.

Related

In spreadsheet (Excel or Google Sheets), how to find the sum of multiple values with multiple rows of column headers criteria?

as in the above picture, I need to sum all the values within the table C8:V22 which match
the first three characters of column B(orange),
row 5 for the number(blue),
row 6 for the first character(green),
row 7 for the first three characters(yellow)
The desire result would be the sum of the number in red, which is 10001 + 10081 + 10161 + 10221 = 40464
I tried many different ways to write the formula, one of that is:
=INDEX($B$5:$V$22,
MATCH($D$26,LEFT($B$5:$B$90,3),0),
MATCH(($F$26=$5:$5) * ($G$26=LEFT($6:$6, 1)) * (H26=LEFT($7:$7,3)), 0))
and pressed Ctrl+Shift+Enter to make it as an array formula, but couldn't figure out where is the error.
Anyone could help on this? Thank you!
Edit: The following is a simplify table for easy reference:
1
2
3
a1
a2
b1
abc1
abdf2
abc2
111a
11
12
13
222a
14
15
16
111b
17
18
19
555a
20
21
22
333d
23
24
25
111a
26
27
28
in this case, the match values are 11 + 17 + 26 = 54
I also tried using combinations of functions such as SUMIFS, SUMPRODUCT, search, e.t.c. but still not able figure out the solution.
In your sheet:
=SUMPRODUCT((LEFT(B8:B22,3)=C26&"")*(C5:V5=E26)*(LEFT(C6:V6,1)=F26&"")*(LEFT(C7:V7,3)=G26&"")*C8:V22)
simply retrieve the sum using your parameters and converting in string to match exactly.
If you have Excel 365 you can use this formula:
=LET(data,C8:V22,
ruleColumnB,LEFT(B8:B22,LEN(D26))=TEXT(D26,"0"),
ruleRow5,C5:V5=F26,
ruleRow6, LEFT(C6:V6,1)=G26,
ruleRow7, LEFT(C7:V7,3) =H26,
SUMPRODUCT(data*ruleColumnB*ruleRow5*ruleRow6*ruleRow7)
)
)
Using LET makes the formula more readable - esp. if you name the rules according to your special context.
If you don't have Excel 365 you have to replace the single parameters within SUMPRODUCT with each range/formula

Subtotals grouped by value using COUNTIF to create ranges for SUMIF, but in a single formula

End-goal: A column with the subtotals of groups (defined in the below table as all foods listed above Zucchini, incl Zucchini).
Current attempt: create a column to define groups using COUNTIF('count all 'zucchini' thus far'). Then use SUMIF to get the total cost for the current group.
Problem: I don't know how to do this without the COUNTIF column (since SUMIF needs range C:C to be resolved first). I'd like to have it in a single formula. I looked into array formulas but not sure if/how to apply that here.
FOOD COST COUNTIF(A2:A$2;"Zucchini") SUMIF(C:C;C2;B:B)
Apple 3 0 12
Pecan 7 0 12
Zucchini 2 0 12
Apple 4 1 23
Olive 8 1 23
Pecan 6 1 23
Zucchini 5 1 23
Apple 4 2 16
Olive 9 2 16
Zucchini 3 2 16
Any ideas on how to solve either the current problem or the end-goal problem? Thanks!
Put this in C2 and copy down:
=IF(A2="Zucchini",SUM($B$1:B2)-SUM($C$1:C1),"")
It basically sums everything to the row and subtracts what is already accounted for.

Possible to use a running total row in powerpivot for calculation in a calculated field?

If I have a pivot table and I set the row to be a running total according to date and right now i will like to use this row to create a calculated field. Is it possible?
If not then is there a formula for cumulative calculations for calculated field?
Will supply more examples if need more clarification.
I want to do something like this
week 1 2 3 4 5 6 7 8 9 10
count 20 20 21 25 26 27 28 29 21 21
cumulative count 20 40 61 86 112 139 167 196 217 238
If the week is the base field then can I create a calculated field that does something like the cumulative count? I am doing this as i need to use the cumulative count for further calculations and if i use the show values as running total it seems to me that I cant use that variable for further calculations.
Hope this helps to clarify.
There are time intelligence functions built into DAX. You could use TOTALYTD(), TOTALQTD(), and TOTALMTD() if you have a proper date dimension with contiguous, non-repeating dates ranging from January 1 in the first year you have data through December 31 in the last year you have data.
If you have a non-standard fiscal calendar you can get the same effect so long as you have index fields for each time granularity of interest which are increasing over time.
CustomTotalYTD:=
CALCULATE(
[<some measure>]
,FILTER(
ALL( 'DimDate' )
,'DimDate'[FiscalYear] = MAX( 'DimDate'[FiscalYear] )
&& 'DimDate'[Date] <= MAX( 'DimDate'[Date] )
)
)

Create a Histogram in Excel with three different level

Based on the picture that I have uploaded, how should I create it in Excel with three different level?
Thanks!
Grades Bins Frequency Intervals
9 9 0 0-9
6 19 2 10-19
1 29 1 20-29
7 39
5
5
2
4
6
2
10
11
15
18
20
21
23
25
26
27
29
To create a histogram in Excel you would use FREQUENCY
This is no diferent in using something such as the groups for colours.
The difference is that you would use an IF statement referring to the group column.
=FREQUENCY(IF(GroupRange="GroupName",DataRange),BinRange)
So if your data was in B2:B40 and your group delimiter in C2:C40 and your bin sizes was in E2:E12 you would use a formula such as:
=FREQUENCY(IF($C$2:$C$40="B",$B$2:$B$40),$E$2:$E$12)
Then pop each group next to each other changing the "B" (or whatever) as you go.
Hopefully this will get oyu on the right track.
(note: with FREQUENCY you must array enter into all cells in line with the bin range... [ctrl]+[shift]+[enter])

Subtotals in excel should repeat

Below is my data in excelsheet :
RID RNO RCOST
----------------
11 2 78
11 3 30
22 6 20
22 8 34
Need to display the subtotal of RCOST grouped on RID as :
RID RNO RCOST
----------------
11 2 108
11 3 108
22 6 54
22 8 54
I am able to calculate the subtotals but unable to populate the same subtotal for all the rows in that particular group.
Please provide some inputs
If you don't plan to keep the original RCost numbers, you will need VBA to collect the conditional sum based on RID then write that total into the RCost column for each RID. If you are planning on keeping the original RCost numbers then a simple SUMIF or SUMIFS function in a new column should suffice. In an unused column to the right,
=sumif(A:A, A2, C:C)
Fill down as necessary.

Resources