VikingLink
New Member
- Joined
- Jun 18, 2022
- Messages
- 30
- Office Version
- 365
- Platform
- Windows
Problem.xlsx | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | |||
1 | Data | TEXTSPLIT(A2;0;", ") | TEXTSPLIT(A3;0;", ") | TEXTSPLIT(A4;0;", ") | VSTACK(E2#;F2#;G2#) | UNIQUE(FILTER(I2#;(COUNTIF(I2#;I2#)>1))) | TEXTJOIN(", ";TRUE;K2#) | ||||||||
2 | Jerry, Layne, Mike, Sean | Jerry | Eddie | Layne | Jerry | Layne | Layne, Mike | ||||||||
3 | Eddie, Stone, Mike, Jeff, Dave | Layne | Stone | Mike | Layne | Mike | |||||||||
4 | Layne, Mike, John, Barrett | Mike | Mike | John | Mike | ||||||||||
5 | Sean | Jeff | Barrett | Sean | |||||||||||
6 | Desired result | Dave | Eddie | ||||||||||||
7 | Layne, Mike | Only duplicates | Stone | ||||||||||||
8 | Mike | ||||||||||||||
9 | Jeff | ||||||||||||||
10 | Dave | ||||||||||||||
11 | Layne | ||||||||||||||
12 | Mike | ||||||||||||||
13 | John | ||||||||||||||
14 | Barrett | ||||||||||||||
15 | |||||||||||||||
16 | |||||||||||||||
17 | |||||||||||||||
18 | |||||||||||||||
19 | TEXTJOIN(", ";TRUE;K2#) | VSTACK(TEXTSPLIT(A2;0;", ");TEXTSPLIT(A3;0;", ");TEXTSPLIT(A4;0;", ")) | UNIQUE(FILTER(VSTACK(TEXTSPLIT(A2;0;", ");TEXTSPLIT(A3;0;", ");TEXTSPLIT(A4;0;", "));(COUNTIF(I2#;I2#)>1))) | ||||||||||||
20 | UNIQUE(FILTER(I2#;(COUNTIF(I2#;I2#)>1))) | Jerry | Layne | ||||||||||||
21 | VSTACK(E2#;F2#;G2#) | Layne | Mike | ||||||||||||
22 | TEXTSPLIT(A4;0;", ") | Mike | |||||||||||||
23 | TEXTSPLIT(A3;0;", ") | Sean | |||||||||||||
24 | TEXTSPLIT(A2;0;", ") | Eddie | UNIQUE(FILTER(VSTACK(TEXTSPLIT(A2;0;", ");TEXTSPLIT(A3;0;", ");TEXTSPLIT(A4;0;", "));(COUNTIF(I2#;VSTACK(TEXTSPLIT(A2;0;", ");TEXTSPLIT(A3;0;", ");TEXTSPLIT(A4;0;", ")))>1))) | ||||||||||||
25 | Stone | Layne | |||||||||||||
26 | Mike | Mike | |||||||||||||
27 | Jeff | ||||||||||||||
28 | Dave | ||||||||||||||
29 | Layne | UNIQUE(FILTER(VSTACK(TEXTSPLIT(A2;0;", ");TEXTSPLIT(A3;0;", ");TEXTSPLIT(A4;0;", "));(COUNTIF(VSTACK(TEXTSPLIT(A2;0;", ");TEXTSPLIT(A3;0;", ");TEXTSPLIT(A4;0;", "));VSTACK(TEXTSPLIT(A2;0;", ");TEXTSPLIT(A3;0;", ");TEXTSPLIT(A4;0;", ")))>1))) | |||||||||||||
30 | Mike | PROBLEM! Replacing the range in the COUNTIF part of the formula gives me a prompt asking if I'm not trying to write a formula. | |||||||||||||
31 | John | ||||||||||||||
32 | Barrett | ||||||||||||||
33 | |||||||||||||||
34 | |||||||||||||||
35 | |||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E5 | E2 | =TEXTSPLIT(A2,0,", ") |
F2:F6 | F2 | =TEXTSPLIT(A3,0,", ") |
G2:G5 | G2 | =TEXTSPLIT(A4,0,", ") |
I2:I14 | I2 | =VSTACK(E2#,F2#,G2#) |
K2:K3 | K2 | =UNIQUE(FILTER(I2#,(COUNTIF(I2#,I2#)>1))) |
M2 | M2 | =TEXTJOIN(", ",TRUE,K2#) |
I20:I32 | I20 | =VSTACK(TEXTSPLIT(A2,0,", "),TEXTSPLIT(A3,0,", "),TEXTSPLIT(A4,0,", ")) |
K20:K21 | K20 | =UNIQUE(FILTER(VSTACK(TEXTSPLIT(A2,0,", "),TEXTSPLIT(A3,0,", "),TEXTSPLIT(A4,0,", ")),(COUNTIF(I2#,I2#)>1))) |
K25:K26 | K25 | =UNIQUE(FILTER(VSTACK(TEXTSPLIT(A2,0,", "),TEXTSPLIT(A3,0,", "),TEXTSPLIT(A4,0,", ")),(COUNTIF(I2#,VSTACK(TEXTSPLIT(A2,0,", "),TEXTSPLIT(A3,0,", "),TEXTSPLIT(A4,0,", ")))>1))) |
Dynamic array formulas. |
I've been trying to work out a way to use one long nested formula to show duplicates from among multiple ranges in a single cell, but I keep getting stuck once I try to combine my multiple formulas.
In the example sheet below you can see what I'm trying to do, and how I combine my formulas step by step.
The data is in cells A2, A3, and A4. The desired result is as you can see in A7. I want it to show the duplicates from the three cells, in just one cell. In E1, F1 and G1 you can see my first step: splitting the data in the arrays to have each name in a single cell. I stack these in I1 so I have just one single array. I then filter that array in K1 to show only the duplicates. That array is then joined in M1. The issue is that I need to be able to do this for a few hundred cells, so I can't spread this across multiple columns, and need to be able to have just 1 formula combining all of these steps.
Below the blacked out cells you can see me combining these step by step, with the results shown below the separate functions in row 1.
Stacking the split up names works just fine. But once I get to the filtering, things go wrong. For some reason I can't get this to work. Once I replace the array of the COUNTIF function with the VSTACKED cells, I get a prompt asking me if I'm not trying to type a formula. Changing the array of I2# at the criteria of the COUNTIF works, and it also works for the array of the FILTER.
Can someone help me with this? And possibly explain why it's not working, so I can learn from this?
Thanks in advance.