Auto Populate Win Sheet via Numbers in another worksheet

New Contributor

I am running a pool and want to have the Win Sheet auto populate an X in a new column for every time the number comes up in the master worksheet.

 

I was trying to use this formula =IF(COUNTIF(Master!E3:E230,"1"),"X"," ") and it does work, however I am not sure how to make it recognize that the number 1 or any other number between 1-100 could  come up more than once in the data set. And to then check the box net to the already checked box in the win sheet.

 

The Numbers are 1-100 and there are 230 Rows that those numbers could come up in one column.

I have manually marked in the sheet I would like to auto populate for reference.

 

Sheet I would like to Auto Populate

                                               
#                                             Total
1XX                                           2
2                                             0
3                                             0
4                                             0
5X                                            1
6X                                            1
7XX                                           2
8                                             0
9                                             0
10XX                                           2
11                                             0
12                                             0
13                                             0
14                                             0
15                                             0
16XX                                           2
17XX                                           2
18                                             0
19                                             0
20X                                            1
21X                                            1
22X                                            1
23X                                            1
24X                                            1
25XXX                                          3
26X                                            1
27XX                                           2
28X                                            1
29XX                                           2
30X                                            1
31X                                            1
32                                             0
33                                             0
34                                             0
35                                             0
36                                             0
37X                                            1
38                                             0
39X                                            1
40XXXX                                         4
41X                                            1
42X                                            1
43X                                            1
44XX                                           2
45XX                                           2
46XX                                           2
47X                                            1
48XX                                           2
49                                             0
50                                             0
51                                             0
52                                             0
53X                                            1
54XXXXX                                        5
55                                             0
56XX                                           2
57XXX                                          3
58X                                            1
59                                             0
60                                             0
61                                             0
62XX                                           2
63                                             0
64                                             0
65                                             0
66XXX                                          3
67                                             0
68X                                            1
69XXXX                                         4
70X                                            1
71XX                                           2
72X                                            1
73X                                            1
74X                                            1
75X                                            1
76                                             0
77X                                            1
78X                                            1
79XXXX                                         4
80X                                            1
81                                             0
82XX                                           2
83XX                                           2
84                                             0
85XX                                           2
86X                                            1
87XXX                                          3
88XX                                           2
89                                             0
90X                                            1
91                                             0
92XX                                           2
93XX                                           2
94X                                            1
95                                             0
96XX                                           2
97                                             0
98XXX                                          3
99XX                                           2
100X                                            

1

 

 

 

Data Set:

17
77
17
7
53
26
70
62
83
42
72
88
54
54
40
99
28
29
69
82
69
66
46
48
25
57
57
54
16
47
86
6
27
22
29
58
66
62
83
82
94
71
1
21
24
80
73
41
100
98
98
93
93
98
20
96
87
85
87
99
23
87
92
57
40
40
66
90
25
45
25
96
68
44
48
43
31
39
37
40
75
79
79
79
74
79
69
69
92
1
10
10
54
45
54
44
5
7
27
71
30
16
56
56
46
78
88
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

11 Replies

@tfrisbie 

=IFERROR(IF(ISNUMBER(SMALL(IF($A3=Master!$E$3:$E$110,ROW(Master!$E$3:$E$110)-2),COLUMN(Master!A$1))),"X",""),"")

You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office365 or Excel 2021. The formula is entered in cell I3 and draged across range I3:M102. In columns B to F are the manually entered expected results.

X.JPG

@tfrisbie 

If you have access to LAMBDA, you could this:

 

 

=MAKEARRAY(100,COUNTIF(numbers,MODE(numbers)),LAMBDA(r,c,IF(c<=COUNTIF(numbers,r),"x","")))

 

This formula creates a 100x5 matrix.  The number of columns can expand depending on how many times the MODE is counted in your numbers list. 

 

This is a fun task. You will get some good options for this one! 

@mtarler @Peter Bartholomew 

@Patrick2788  OK because I got called out I had to throw another option out there. lol

=LET(list, $A$1:INDEX($A:$A,COUNT($A:$A)), nn, numbers,
IFERROR(TEXTSPLIT(TEXTJOIN(";",0,REPT("x,",COUNTIF(nn,list))),",",";"),""))

so line 1 is just defining the 2 input ranges and all the 'work' is done on line 2

Patrick, I really like your idea of using MODE() to define the # of columns

I also notice you assumed the range of numbers would be the sequence from 1 to X while the above uses the numbers in col A.  Another option might be to create the list of used values (inclusive or exclusive of unused values in between used values).

@Patrick2788 

A simple dynamic array solution will do here.  Lambda and helpers get you into the Microsoft nested arrays error (their error I contend, not ours).

= LET(
      count, COUNTIFS(Data, numbers),
      n,     MAX(count),
      k,     SEQUENCE(1,n),
      wins,  IF(k<=count,"X",""),
      VSTACK(k,wins)
  )

 

@Peter Bartholomew @mtarler 

I seldom use MAKEARRAY, but this request seemed like a good opportunity to put it to use. If timed to the millisecond, it's undoubtedly the slowest of the solutions.  EXPAND is another one but there's only so much one can do with that one.

Thanks Patrick - I do not have access to Lambda, However I will look into this further - may have it through a work account and not know.
Thank you - I am struggling to adjust this to my spreadsheet, but I will keep working on it - This gives me something to work on!
A lot of companies use the Semi-Annual update channel where these functions aren't available, but you may have access to them in the Excel web app.

@Patrick2788 

I agree, a whole new toolbox has been provided and there is every reason to build up experience of the use of new tools.  Some problems will have natural solutions that form a 2D array of single-cell results.  Others really do require Microsoft to sort the 'nested arrays' error.  There are problems whereby I have been reduced to performing a computationally intensive calculation to return a 1D array, select one term, then recalculate the same array.

@tfrisbie 

If you are still having problems, it may be that

= LET(
      count, COUNTIFS(Data, numbers),
      n,     MAX(count),
      k,     SEQUENCE(1,n),
      wins,  IF(k<=count,"X",""),
  )

would work for you.  I have removed the VSTACK that I used simply to lay out the results sheet because the array manipulation functions came out even later than LAMBDA.  If I were developing this formula for my own use, I would create a custom Lambda function so that the formula has the same look and feel as every other formula throughout my workbook but that has most users feeling faint and reaching for the smelling salts!

Thanks Peter -

Unfortunately I do not have access to LAMBDA so that's unfortunate! But I appreciate the response.