Percetile complications - excel

I am trying to find the bottom 33%, middle 33% and upper 33% from my dataset.
What I need:
I need to get the percentile for individuals in excel. I have hundreds of people and next to them the managers name so I have been using the below formula to get the percentile based on manager.
Current Formula:
=IF(G2<AGGREGATE(18,6,G$2:G$1000/(AS$2:AS$1000=AS2),0.3333333),"Bottom",IF(G2<AGGREGATE(18,6,G$2:G$1000/(AS$2:AS$1000=AS2),0.66666666),"Middle","Top"))
Problem:
This formula should have the words top, middle and bottom against every manager at least once. But I have noticed some managers only having a top and middle. Clearly I am missing something?
Update:
I have also used the below formula against just the numbers and not receiving 'bottom' at all
=IF(A1<PERCENTILE.EXC(A:A,33.33333%),"Bottom 33%",IF(A1<PERCENTILE.EXC(A:A,66.666666%),"Middle","Upper"))
SAMPLE NUMBERS:
6.31025416
5.18260342
5.25185395
4.57484582
4.99563873
6.31717482
3.49576271
4.21992744
5.02853494
4.77338476
4.9579394
4.00174679
4.04134247
4.66614821
4.264681
1.94515737
3.96117421 0 0
1.35109777 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.97126669
0.99805933 0 0 0

If you want to exclude the 0 use this:
=IF(G2<>0,IF(G2<AGGREGATE(18,6,G$2:G$1000/((AS$2:AS$1000=AS2)*(G$2:G$1000<>0)),0.3333333),"Bottom",IF(G2<AGGREGATE(18,6,G$2:G$1000/((AS$2:AS$1000=AS2)*(G$2:G$1000<>0)),0.66666666),"Middle","Top")),"")

Related

excel extendable formula for conditional sums over multiple columns

I have an arbitrary number of columns, one for each period a course is offered, in chronological order, and an arbitrary number of rows, one for each unique participant. The values are '1' for participation in that month, '0' for non-participation.
Fall2019 Spring2019 Fall2018 Spring2018 Fall2017
1 1 0 1 0
0 1 1 1 1
0 1 1 1 1
0 1 1 1 1
0 1 0 1 1
0 1 1 0 0
0 1 1 0 0
0 1 1 0 0
1 0 0 0 0
I would like to take a sum, at the bottom of each column, for how many participants were first time attendees that period, i.e. the sum of '1's where all values in the row to the right of that '1', are '0'.
In the given example set, Spring2018 should sum to 1, Fall2018 should sum to 3.
Something like the formula below will work for 'Spring2018' when there is just one previous column to compare:
=SUMPRODUCT((D2:D9)*(E2:E9=0))
But this formula cannot be 'autofilled' or extended across multiple columns... i.e. none of these variations work:
=SUMPRODUCT((C2:C9)*(D2:$E9=0))
=SUMPRODUCT((C2:C9)*(SUM(D2:$E9)=0))
=SUMPRODUCT((C2:C9)*(SUMIF(D2:$E9,"0")))
And while it will work, I do NOT want to have to manually create extended versions of this formula e.g.
=SUMPRODUCT((C2:C9)*(D2:D9+E2:E9=0))
=SUMPRODUCT((B2:B9)*(C2:C9+D2:D9+E2:E9=0))
... and so on
I have tried several variations on arrayformula, sumproduct, and sumif, but I'm really stuck. Any assistance is appreciated.
use this array formula:
=SUM(A2:A10*(MMULT(--(B$2:$E$10=1),TRANSPOSE(COLUMN(B$2:$E$10)^0))=0))
Being an array formula it must be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.

Count rows in excel with certain value

I need to count the number of rows in an excel spreadsheet that contains the number 1.
- A B C
1 0 0 1
2 0 0 0
3 0 1 0
It would look somewhat like this, except with around 1000 rows.
Any help is great!
To count any value attending to some criteria you can use COUNTIF(cells,criteria)
More details here: https://support.office.com/en-us/article/countif-function-e0de10c6-f885-4e71-abb4-1f464816df34
Hope it helps

Count of consecutive repeated value only when repeated 3+ times

My goal is to count and potentially conditionally format the occurrences when a certain number of days pass with 0 sales.
I am trying to return the number of times 0 is repeated consecutively 3 or more times. So for this example I would like to see the return value of 3. So far I can't wrap my brain around how to do this, any ideas?
1
5
0
0
0
0
0
2
0
0
1
0
2
0
0
0
5
0
0
0
0
Thanks!
So #Barry Houdini's method applied to this problem would give
=SUM(--(FREQUENCY(IF(A1:A21=0,ROW(A1:1A21)),IF(A1:A21>0,ROW(A1:A21)))>=3))
entered as an array formula using CtrlShiftEnter
If you wanted to make it more dynamic and exclude blanks you could use
=SUM(--(FREQUENCY(IF(A1:A100<>"",IF(A1:A100=0,ROW(A1:A100))),IF(A1:A100>0,ROW(A1:A100)))>=3))
How about you make a help column with a simple sum formula with a "window" of three rows (or whatever you need). Then you conditionally format all values which are 0 in that column. That should provide you with the information you are looking for.

Calculate percentage using functions

I have an Excel workbook (Office 2010) that lists multiple different spreadsheets (offices) in our organization. We use this workbook to keep track of their "errors" in turned-in documents (example only). I'm trying to figure out a good way to determine, through automation (functions) the percentage of documents that have had errors in them. I want to determine the percentage of documents looked at versus the amount of errors, completely ignoring the amount of errors. So if I looked at 10 documents and 7 of those had at least one error, the office's percentage of errors would be 70%.
Is there any easy way to do this?
I've tried a few functions but I continue to get errors. I show a sample sheet (one office) below. This example is similar across multiple sheets and there is a dashboard that I would like to display all of these statistics based on offices.
workpaper DISCREPENCIES
Paper Spelling Grammar Punctuation Total Errors/Paper
A.36.7 1 0 1 2
A.36.8 0 1 1 2
A.36.9 0 1 0 1
A.36.10 0 0 0 0
A.36.11 1 0 0 1
A.36.12 1 1 1 3
A.36.13 2 3 0 5
A.36.14 0 0 0 0
A.36.15 0 0 0 0
A.36.16 1 1 1 3
Total Errors 17
Total Documents 10
Total Documents w/ errors 7
Percentage of Errors 70%
I can do all of this manually but I would like to find a way to do this across all sheets since there are a quite a few and output them to a "dashboard" that has all offices listed in rows.
One way is to look at the number of worksheets with 0 errors in them. Then subtract that percentage from 100%. For example in G5:
=COUNTIF(E3:E12,0)/COUNT(E3:E12)
and in G6:
=100%-G5

Excel Formulation/table

Scientists at the research institute for robotics have created a new type of robot that reproduces itself. The new robot takes two weeks to gather materials and then builds one new robot(exactly like itself) each week for three weeks. The first new robot is activated at the end of week 3, the second new robot is activated at the end of week 4 and the third new robot at the end of week 5. as soon as it is created, each new robot goes through the same cycle of gathering materials for two weeks and then creating three new robots, one per week. And so on for each of the new robots. At the end of the first five weeks of its existence each new robot ceases building new robots but retires and lives forever. The scientists plan to build only one robot with their own hands and then set it in motion. Create an excel worksheet that will tell you how many robots there will be in 2 years.
i have search but the answer wasn't enough to help me figure this out. any help out there?
#yosukesabai is quite right - this is a Markov chain problem, and once you've worked out how to set up the transition matrix it's very easy to solve. If we know how many robots of each age we have at the end of each week (in complete weeks, capped at 5), we can use the transition matrix to calculate the number of robots of each age at the end of the following week.
The transition matrix can be written like this:
0 1 0 0 0 0
0 0 1 0 0 0
1 0 0 1 0 0
1 0 0 0 1 0
1 0 0 0 0 1
0 0 0 0 0 1
For each robot of age y at the end of the week, there will be T(x,y) robots of age x at the end of the next week (x = column number, y = row number, both starting at 0). The entries are all filled in according to the puzzle description.
The starting state in week 0 is a single robot of age 0, and no other robots of any other ages. This can be represented as a row vector:
1 0 0 0 0 0
You can now use the MMULT function to get from week zero to week one. If you put the transition matrix in cells J2:O7 and the vector for week 0 in cells B3:G3, it can be entered as:
=MMULT(B3:G3,$J$2:$O$7)
This needs to be entered as an array formula. Select cells B4:G4, press F2, enter the formula and press Ctrl + Shift + Enter. You should now see the following in B4:G4:
0 1 0 0 0 0
You can then copy & paste these cells down into another 103 rows to see how robots you have after 2 years. I get 5,369,858,819,104 at the end of week 104.

Resources