This has reference to one of my post (Filter problem) which was solved. However, I´m facing an issue. I think the formula searches for first digit only. If there is more than 1 digit number, it will search & return true if one of the digits match the search text. I suspect SEARCH is not working properly. I´m sure I must have made silly mistake but couldn´t figure out. Can the experts in this forum help please?
Consider the following example. Table 1 has t id & used r id. Table 2 has r id & t ref. I have to find out which item under r id in table 2 is called under used r id in table 1.
The formula works well to some extent. But when a number is repeated in any of the digits, it is returning incorrect result.
Let´s look into few results -
- rq id 9 is not used in table 1, but formula returns 3, 8 since it has 89. Formula detects 9 in 89 & returns true.
- rq id 1 is used only in t id 2 in table 1, but formula returns 1, 2, 6 since 1 & 6 has 11 & returns true.
Table 1 -
Table 2 -
Expected result - Incorrect results are highlighted in orange cell color.
Consider the following example. Table 1 has t id & used r id. Table 2 has r id & t ref. I have to find out which item under r id in table 2 is called under used r id in table 1.
The formula works well to some extent. But when a number is repeated in any of the digits, it is returning incorrect result.
Let´s look into few results -
- rq id 9 is not used in table 1, but formula returns 3, 8 since it has 89. Formula detects 9 in 89 & returns true.
- rq id 1 is used only in t id 2 in table 1, but formula returns 1, 2, 6 since 1 & 6 has 11 & returns true.
Table 1 -
Book1 | |||||
---|---|---|---|---|---|
B | C | D | |||
2 | t id | desc | used r id | ||
3 | 1 | fdsfds | 11 | ||
4 | 2 | fdfds | 1,11,2 | ||
5 | 3 | er | 89 | ||
6 | 4 | ere | 32 | ||
7 | 5 | vvafd | 3,5 | ||
8 | 6 | wqw41 | 73,32,11 | ||
9 | 7 | yiy8 | 5,55 | ||
10 | 8 | 65jg | 89 | ||
11 | 9 | ere | 2 | ||
12 | 10 | 3y4y | 3 | ||
Sheet1 |
Table 2 -
Book1 | |||||
---|---|---|---|---|---|
B | C | D | |||
2 | rq id | rq | t ref | ||
3 | 1 | vcv | 1, 2, 6 | ||
4 | 11 | 41d | 1, 2, 6 | ||
5 | 2 | kukyu | 2, 4, 6, 9 | ||
6 | 32 | yutry | 4, 6 | ||
7 | 3 | 4fv | 5, 6, 10 | ||
8 | 73 | urtr | 6 | ||
9 | 5 | c<c | 5, 7 | ||
10 | 55 | nbmb | 7 | ||
11 | 9 | eqq | 3, 8 | ||
12 | 89 | 796k | 3, 8 | ||
Sheet 2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D3:D12 | D3 | =LET( x,Table2[t id], y,Table2[used r id], IFERROR(TEXTJOIN(", ",,(FILTER(x,ISNUMBER(SEARCH([@[rq id]]&",",y & ","))))),"no value")) |
Expected result - Incorrect results are highlighted in orange cell color.
Book1 | ||||
---|---|---|---|---|
G | H | |||
1 | expected values in t ref | |||
2 | rq id | t ref | ||
3 | 1 | 2 | ||
4 | 11 | 1,2,6 | ||
5 | 2 | 2,9 | ||
6 | 32 | 4,6 | ||
7 | 3 | 5,10 | ||
8 | 73 | 6 | ||
9 | 5 | 5,7 | ||
10 | 55 | 7 | ||
11 | 9 | no value | ||
12 | 89 | 3,8 | ||
Sheet 2 |