Georgiboy
Well-known Member
- Joined
- Nov 7, 2008
- Messages
- 1,501
- Office Version
- 365
- 2016
- Platform
- Windows
Hi all,
I have been learning dynamic array formulae as i move from a more VBA background to formulae. I was trying to help someone on here earlier and got very stuck, we are talking about three hours of stuck trying to figure this out and i feel it should be quite simple..
I have the below and i have been trying to join the formula in column E to the formula in column C:
As above it works but i wanted them in one formula so i could omit the 'Existing Numbers' column and leave 'Code' & 'Missing Numbers' columns.
Below is my best go at joining them together:
I suppose i am looking for an explanation of what i have done wrong and a way of doing it right?
Not really looking for a faster/ better way to do it - just trying to learn but have got rather stuck
I have been learning dynamic array formulae as i move from a more VBA background to formulae. I was trying to help someone on here earlier and got very stuck, we are talking about three hours of stuck trying to figure this out and i feel it should be quite simple..
I have the below and i have been trying to join the formula in column E to the formula in column C:
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Example | Code | Existing Numbers | Missing Numbers | |||
2 | Example1 | Example | 0, 1, 2, 3, 5, 6, 8, 9 | 4, 7 | |||
3 | Example2 | BSmith | 0, 1, 3, 6, 7, 9, 10, 11, 12, 13, 15, 17, 18, 19 | 2, 4, 5, 8, 14, 16 | |||
4 | Example3 | Dave | 1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19 | 3, 9, 15 | |||
5 | Example5 | ||||||
6 | Example6 | ||||||
7 | Example8 | ||||||
8 | Example9 | ||||||
9 | BSmith | ||||||
10 | BSmith1 | ||||||
11 | BSmith3 | ||||||
12 | BSmith6 | ||||||
13 | BSmith7 | ||||||
14 | BSmith9 | ||||||
15 | BSmith10 | ||||||
16 | BSmith11 | ||||||
17 | BSmith12 | ||||||
18 | BSmith13 | ||||||
19 | BSmith15 | ||||||
20 | BSmith17 | ||||||
21 | BSmith18 | ||||||
22 | BSmith19 | ||||||
23 | Dave1 | ||||||
24 | Dave2 | ||||||
25 | Dave4 | ||||||
26 | Dave5 | ||||||
27 | Dave6 | ||||||
28 | Dave7 | ||||||
29 | Dave8 | ||||||
30 | Dave10 | ||||||
31 | Dave11 | ||||||
32 | Dave12 | ||||||
33 | Dave13 | ||||||
34 | Dave14 | ||||||
35 | Dave16 | ||||||
36 | Dave17 | ||||||
37 | Dave18 | ||||||
38 | Dave19 | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:D4 | C2 | =LET( nums,IFERROR(--BYROW(A1:A38,LAMBDA(x,RIGHT(x,LEN(x)-MIN(FIND({0,1,2,3,4,5,6,7,8,9},x&"0123456789"))+1))),0), words,SUBSTITUTE(A1:A38,nums,""), u,UNIQUE(words), result,BYROW(u,LAMBDA(br,TEXTJOIN(", ",,FILTER(nums,words=br)))), HSTACK(u,result)) |
E2:E4 | E2 | =BYROW(C2#,LAMBDA(x,TEXTJOIN(", ",TRUE,LET(ts,--TEXTSPLIT(INDEX(x,,2),", "),sq,SEQUENCE(,MAX(ts)),FILTER(sq,NOT(ISNUMBER(MATCH(sq,ts,0)))))))) |
Dynamic array formulas. |
As above it works but i wanted them in one formula so i could omit the 'Existing Numbers' column and leave 'Code' & 'Missing Numbers' columns.
Below is my best go at joining them together:
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Example | Code | Existing Numbers | Missing Numbers | |||
2 | Example1 | Example | 0, 1, 2, 3, 5, 6, 8, 9 | #CALC! | |||
3 | Example2 | BSmith | 0, 1, 3, 6, 7, 9, 10, 11, 12, 13, 15, 17, 18, 19 | #CALC! | |||
4 | Example3 | Dave | 1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19 | #CALC! | |||
5 | Example5 | ||||||
6 | Example6 | ||||||
7 | Example8 | ||||||
8 | Example9 | ||||||
9 | BSmith | ||||||
10 | BSmith1 | ||||||
11 | BSmith3 | ||||||
12 | BSmith6 | ||||||
13 | BSmith7 | ||||||
14 | BSmith9 | ||||||
15 | BSmith10 | ||||||
16 | BSmith11 | ||||||
17 | BSmith12 | ||||||
18 | BSmith13 | ||||||
19 | BSmith15 | ||||||
20 | BSmith17 | ||||||
21 | BSmith18 | ||||||
22 | BSmith19 | ||||||
23 | Dave1 | ||||||
24 | Dave2 | ||||||
25 | Dave4 | ||||||
26 | Dave5 | ||||||
27 | Dave6 | ||||||
28 | Dave7 | ||||||
29 | Dave8 | ||||||
30 | Dave10 | ||||||
31 | Dave11 | ||||||
32 | Dave12 | ||||||
33 | Dave13 | ||||||
34 | Dave14 | ||||||
35 | Dave16 | ||||||
36 | Dave17 | ||||||
37 | Dave18 | ||||||
38 | Dave19 | ||||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:E4 | C2 | =LET( nums,IFERROR(--BYROW(A1:A38,LAMBDA(x,RIGHT(x,LEN(x)-MIN(FIND({0,1,2,3,4,5,6,7,8,9},x&"0123456789"))+1))),0), words,SUBSTITUTE(A1:A38,nums,""), u,UNIQUE(words), result,BYROW(u,LAMBDA(br,TEXTJOIN(", ",,FILTER(nums,words=br)))), tj,BYROW(result,LAMBDA(x,TEXTJOIN(", ",TRUE,LET(ts,--TEXTSPLIT(x,", "),sq,SEQUENCE(,MAX(ts)),FILTER(sq,NOT(ISNUMBER(MATCH(sq,ts,0)))))))), HSTACK(u,result,tj)) |
Dynamic array formulas. |
I suppose i am looking for an explanation of what i have done wrong and a way of doing it right?
Not really looking for a faster/ better way to do it - just trying to learn but have got rather stuck