Creating a new filtered list from a dynamically created list based on previous numbers

vampsthevampyre

New Member
Joined
Apr 29, 2016
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Morning All,

Back for help with a new question, I have a list of generated number sequences CR13 down to CR35, I'm then looking to filter this list based on if any numbers appear in the previous group of four numbers.

In the below example the first group of 4 numbers (0,1,2,3) is always accepted but the second set of 4 numbers (1,2,4,5) is rejected because numbers 1 and 2 appear in the previous accepted group of 4,
sequence 3 an 4 are accepted because none of the numbers appear in group 1,
group 5 is rejected because 17 and 20 appear in group 4 (third accepted group of numbers)
group 6 is rejected because 2,3 and 5 appear in sequence 1 and 3.

The final filtered list should look like the list in column DA13-DA18

I have highlighted the accepted numbers in yellow and rejected numbers in red.

Is there a formula that can perform this calculation

Any help would be appreciated

Regards

Ian

roulette.xlsx
CQCRCSCTCUCVCWCXCYCZDA
12IDSortedInitialOrderActual1st2nd3rd4thNew List
1310_1_2_3TRUE1TRUE01230_1_2_3
1421_2_4_5FALSEFALSE12454_5_7_8
1534_5_7_8FALSE2TRUE457816_17_19_20
16416_17_19_20FALSE3TRUE1617192029_30_32_33
17517_18_20_21FALSEFALSE1718202111_12_14_15
1862_3_5_6FALSEFALSE235622_23_25_26
1975_6_8_9FALSEFALSE5689
2088_9_11_12FALSEFALSE891112
21913_14_16_17FALSEFALSE13141617
221029_30_32_33FALSE4TRUE29303233
23117_8_10_11FALSEFALSE781011
241211_12_14_15FALSE5TRUE11121415
251314_15_17_18FALSEFALSE14151718
261419_20_22_23FALSEFALSE19202223
271520_21_23_24FALSEFALSE20212324
281626_27_29_30FALSEFALSE26272930
291728_29_31_32FALSEFALSE28293132
301832_33_35_36FALSEFALSE32333536
311910_11_13_14FALSEFALSE10111314
322031_32_34_35FALSEFALSE31323435
332122_23_25_26FALSE6TRUE22232526
342223_24_26_27FALSEFALSE23242627
352325_26_28_29FALSEFALSE25262829
Moving Corners
Cell Formulas
RangeFormula
CQ13:CQ35CQ13=SEQUENCE(COUNTA(CR13#))
CR13:CR35CR13=TRANSPOSE(SORTBY(Table3692654[[#Headers],[0_1_2_3]:[32_33_35_36]],OFFSET(AH12,MAX(Table3692654[Session])-1,,,23),1))
CS13:CS35CS13=IF(CQ13#=1,TRUE,FALSE)
CV13:CV35CV13=XLOOKUP(CR13#,Table54[Corner],Table54[1],"Missing",0)
CW13:CW35CW13=XLOOKUP(CR13#,Table54[Corner],Table54[2],"Missing",0)
CX13:CX35CX13=XLOOKUP(CR13#,Table54[Corner],Table54[3],"Missing",0)
CY13:CY35CY13=XLOOKUP(CR13#,Table54[Corner],Table54[4],"Missing",0)
Dynamic array formulas.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I'm not sure if column A already has TRUE/FALSE values. If so, then it could be:


Excel Formula:
=FILTER(CR2:CR23,CU2:CU23="TRUE")
 
Upvote 0
Hello, two steps approach (i.e. with helper column) could be:

a) Insert into CS13 and drag down:

Excel Formula:
=LET(
a,--(TEXTSPLIT(CR13,,"_")),
b,--((TEXTSPLIT(TEXTJOIN("_",TRUE,CS$12:CS12),,"_")),
c,SUM(XLOOKUP(a,b,b,0)),
IF(c=0,CR13,""))

b) Use FILTER to obtain the new list.

But I guess you are looking for a single dynamic formula?
 
Upvote 0
Sorry CU column was just for my reference,
We can use that column.
Put the following formula in CU2 and copy down.
Excel Formula:
=LET(a,CV$1:CY1,IF((COUNTIF(a,CV2)+COUNTIF(a,CW2)+COUNTIF(a,CX2)+COUNTIF(a,CY2))=0,TRUE,FALSE))

Now in DA2:
Excel Formula:
=FILTER(CR2:CR23,CU2:CU23=TRUE)

Check: Rows 24 and 33 should be rejected:
1729277639296.png


🤗
 
Upvote 0
We can use that column.
Put the following formula in CU2 and copy down.
Excel Formula:
=LET(a,CV$1:CY1,IF((COUNTIF(a,CV2)+COUNTIF(a,CW2)+COUNTIF(a,CX2)+COUNTIF(a,CY2))=0,TRUE,FALSE))

Now in DA2:
Excel Formula:
=FILTER(CR2:CR23,CU2:CU23=TRUE)

Check: Rows 24 and 33 should be rejected:
View attachment 118256

🤗
Getting close, but it gives all false results, if you look at CV15 this line gives a FALSE result because of the 4 in CX14, I need some way of ignoring previous false results from the new countif line. and yes I have made a manual mistake in my example, well spotted
 
Upvote 0
Getting close, but it gives all false results
Sorry, I didn't realize, I had the data wrong on my sheet.

These are the correct formulas:
In CU13 and copy down:
Excel Formula:
=LET(a,CV$12:CY12,IF((COUNTIF(a,CV13)+COUNTIF(a,CW13)+COUNTIF(a,CX13)+COUNTIF(a,CY13))=0,TRUE,FALSE))

Now, jus in cell DA13:
Excel Formula:
=FILTER(CR13:CR35,CU13:CU35=TRUE)

1729281377089.png


😅
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,223,101
Messages
6,170,116
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top