How to generate the equal number of groups per week that have members that change the group every week - excel

I have been trying to create an excel that I can use to assign members to a group per week. I need to make sure that each member is in the different group every week.
Below is my excel and here is the formula I use in B3
=INDEX(UNIQUE(RANDARRAY(2, 10, 1, 11)), SEQUENCE(1), {1,2,3,4,5,6,7,8,9,10,11})
The issue i cannot fix is the fact that the groups differ in sizes? Any ideas please.
Week 1 2
PPLs
1 7 8
2 6 11
3 1 3
4 2 7
5 9 7
6 2 10
7 4 8
8 4 5
9 10 8
10 8 9
11 3 6
12 8 6
13 7 9
14 7 8
15 5 8
16 5 8
17 8 8
18 8 10
19 4 9
20 3 2
21 10 9
22 2 10
23 10 6
24 9 3
25 4 9
26 7 6
27 10 7
28 7 7
29 10 5
30 2 5
31 6 6
32 8 8
33 4 4
34 9 10
35 5 9
36 9 7
37 5 7
38 10 9
39 2 10
40 6 5
41 9 2

2 thoughts : simple&(somewhat)repeatable OR noExcel&random.
[ simple&(somewhat)repeatable ]
2 sets only.
Set 1 : group 1 is {member 1-10}, group 2 is {member 11-20} .. group 10 is {member 91-100}
Set 2 : group 1 is {member 1,11,21,31,41,51,61,71,81,91}, group 2 is {member 2,12,22,32,42,52,62,72,82,92} .. group 10 is {member 10,20,30,40,50,60,70,80,90,100}
p/s : although member 1 is always is group 1.. I'd consider it is as a valid group change, since ALL other members of group 1 had changed.
[ noExcel&random ]
Ever heard of 10x10 sudoku? it is widely available online. I have no specific one.. But Sudoku, IS what I meant by noExcel.
example 10x10 sudoku solution :
how to use it :
get 5 different (different is important) solved 10x10 sudoku set, and put it one on top of each other. We should get a 10(col)x50(row) table.
Sort by all 1st row, shall have the sequence (from top, in column 1) : 1,1,1,1,1,2,2,2,2,2,3,3,3,3,3, .. 9,9,9,9,9,10,10,10,10,10
Since we have 50 members (10groups, 5members each). Column 1 will be the assigned group for 50 respective (row) member in week1, Column 2 will be the assigned group for week2... and so on.
if every week is different group, then by week 11 it will come back to his/her original group. OR .. another (5 10x10 sudoku) set perhaps?
(If the idea is unclear.. please ask)
AFAIK. with the rules of sudoku itself, each member(row) will have a different group each week(column), and each element (group number) WILL be repeated for 5 times for each week(column). Thus, solve the
the fact that the groups differ in sizes
part. (please share if this doesn't work though..)
ref : I used https://sudokuspoiler.azurewebsites.net/Sudoku/Sudoku10 to solve http://www.sudoku4me.com/sudoku%2010x10.php puzzle (this solver need 0 to be replaced with 10). As long as it is a valid sudoku solution, it should be fine. Some sudoku use letters instead of numbers. Still, the idea applies.
p/s : I tried excel built in random number generator to generate a ranked (sorted) list, but still end up unable get consistent 5 members per group arrangement, with different group each week (same trouble as OP). I had a fond memory with 9x9 Sudoku, glad to know it came in handy for this solution.

Related

Add ordinal number column to output of custom verb in J

If I type !i.10 it gives the factorial of first 10 numbers.
However if I try to add a column of ordinal numbers >/.!i.10, 1+i.10, then J freezes or I get an "Out of memory" error. How do I create custom tables?
I think that what is happening is that you are creating something much bigger than you expect. Taking it in steps:
1+ i. 10 NB. list of 1 to 10
1 2 3 4 5 6 7 8 9 10
10 , 1+ i. 10 NB. 10 prepended
10 1 2 3 4 5 6 7 8 9 10
i. 10 , 1+ i. 10 NB. creates an 11 dimension array with shape 10 1 2 3 4 5 6 7 8 9 10 and largest value of 36287999
When you apply ! to that i. 10 , 1+ i. 10 you get some very large numbers. I am not sure what you are trying to do with the leading >/.
Is this what you had in mind?
(!1 + i.10),. (1+i.10) NB. using parenthesis to isolate operations
1 1
2 2
6 3
24 4
120 5
720 6
5040 7
40320 8
362880 9
3.6288e6 10
To give extended type and get rid of the 3.6288e6 we can use x:
(x:!1 + i.10),. (1+i.10)
1 1
2 2
6 3
24 4
120 5
720 6
5040 7
40320 8
362880 9
3628800 10
or tacit
(x:#! ,. ]) # (1+i.) 10
1 1
2 2
6 3
24 4
120 5
720 6
5040 7
40320 8
362880 9
3628800 10
Or a version I find a little better
([: (,.~ !) 1x + i.) 10
1 1
2 2
6 3
24 4
120 5
720 6
5040 7
40320 8
362880 9
3628800 10

Pandas DataFrame: how do we keep columns based on the index name?

I seem to run into some python or enumerate bugs that I am not quite sure how to fix it (See here for more details).
Long story short, I desire to see multiple data sets that has a column name of 0,4,6,8,10,12,14.
0 4 6 8 10 12
1 2 5 4 2 1
5 3 0 1 5 10
....
But my current data looks like the following
0 4 2 6 8 10 12
1 2 5 4 2 1
5 3 0 1 5 10
....
Therefore, I would like to add a code that keeps columns based on the index number (including only 0,4,6,8,10,12).
Is there a pandas function that can help with this?

Excel: HLOOKUP() where blank cells are skipped

I am trying to create an HLOOKUP() style formula that, if it finds a matching heading where the reported value of the row it's on except if it is blank it skips it and looks for the next column with the same heading in the same row.
An example of the data table is as follows:
Heading 1 Heading 2 Heading 1 Heading 4 Heading 5 Heading 1
Sample 1 1 7 13 19
Sample 2 8 14 20 2
Sample 3 9 15 21 3
Sample 4 4 10 16 22
Sample 5 5 11 17 23
Sample 6 12 6 18 24
As you can see, the data under headings 2, 4 and 5 are all in single columns, but the heading 1 values are split between three columns.
I need the final data set to look like this:
Heading 1 Heading 2 Heading 4 Heading 5
Sample 1 1 7 13 19
Sample 2 2 8 14 20
Sample 3 3 9 15 21
Sample 4 4 10 16 22
Sample 5 5 11 17 23
Sample 6 6 12 18 24
I have done some research online and have found a formula that I thought was meant to work as a VLOOKUP(), I can't quite work out what it's doing and when I try it on a transposed version of my data set it doesn't quite do what I expect. I Have been trying to get it work in and also convert it to work in the opposite orientation. The formula is as follows:
{=INDEX($B$3:$G$8,SMALL(IF(INDEX($A$3:$G$8,,MATCH(B$11,$B$2:$G$2,0))<>"",IF($A$3:$A$8=$A12,ROW($A$3:$G$8)-ROW($A3)+$I12)),1),MATCH(B$11,$B$2:$G$2,0))}
This formula is from https://www.mrexcel.com/forum/excel-questions/689238-vlookup-match-but-ignore-blank-cells.html
Running the formula on a transposed version of my data set results in the following:
**Transposed data set**
Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 Sample 6
Heading 1 1 4 5
Heading 2 7 8 9 10 11 12
Heading 1 6
Heading 4 13 14 15 16 17 18
Heading 5 19 20 21 22 23 24
Heading 1 2 3
**Result**
Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 Sample 6
Heading 1 1 0 3 0 5 0 1
Heading 2 7 8 9 10 11 12 2
Heading 4 13 14 15 16 17 18 3
Heading 5 19 20 21 22 23 24 4
**Expected result**
Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 Sample 6
Heading 1 1 2 3 4 5 6
Heading 2 7 8 9 10 11 12
Heading 4 13 14 15 16 17 18
Heading 5 19 20 21 22 23 24
I think that I am probably over complicating this and that there must be a simpler solution to the problem. Any help that anyone can give me would be great. Let me
Thanks!
This is maybe faaar to simple, but why don't you simply add the values of the ´Heading 1´ columns? The empty values are treated as value 0, and by the end you'll have the values you are looking for :-)

Excel - calculating the median without removing duplicates

I have a table that looks like this:
ID Total
3 3
3 3
3 3
4 11
4 11
4 11
4 11
4 11
4 11
6 9
6 9
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
I would like to calculate the median of column B (Total), excluding duplicate combinations of columns A and B. This could be achieved by constructing a table as below, and calculating the median from that table.
ID Total
3 3
4 11
6 9
7 13
Is there any way of obtaining the median without having to go through this process of manually deleting duplicates?
=MEDIAN(IF(FREQUENCY(MATCH(A2:A25&"|"&B2:B25,A2:A25&"|"&B2:B25,0),ROW(A2:A25)-MIN(ROW(A2:A25))+1),B2:B25))
There is a way with two additional columns. The first column is concatenation of ID and Total, the second counts occurences of each individual combination. Then you just do the median on those rows where the combination occurs for the first time.

Predictive formula

I would like to predict how much we should keep in a box "Magical-box"
"Magical-box" Should have the ability to predict the value of the next deposit in it :
For Example :
DepositNbr Coins MagicBox
1 6 6
2 4 4
3 10 13 <==> the prediction process may starts from the third deposit
4 13 8
5 8 23
6 23 2
7 2 ...
is there any way to perform this prediction based on the past or the present ?,any formula ( markov Chain , normal distribution,Regression... ) is welcomed

Resources