Forum Discussion
Pedro_Duarte
Nov 15, 2022Copper Contributor
Text join + filter data
i'm trying to join text that are equal in coloumn A but values start in some text cell and end on other text cell but it has to be in the line taht is equal in coloumn A
=UNIRTEXTO(", ";VERDADEIRO;SE((D2)=(Folha2!A:A);SE(Folha2!B:AJ<>"";Folha2!B:AJ;"");""))
number 15406 (to be equal in sheet2 A:A)
Start Paredes (to be the start of the join text that is located in sheet2 B:AJ)
Finish Rio tinto (to be the end of the join text that is located in sheet2 B:AJ)
being that number is 1 parameter to be equal and the start is the begining of the filter and the Finish is the last value to be joined but start and finish are changeable.
it's showing every result and it should be showing only from "paredes" to "rio Tinto"
number | 15406 |
Start | Paredes |
Finish | Rio tinto |
Result | Penafiel, Paredes, Oleiros, Irivo, Cête, Parada, Recarei-Sobreira, Trancoso, Terronhas, São Martinho do Campo, Valongo, Suzão, Cabeda, Ermesinde, Águas Santas/ Palmilheira, Rio Tinto, Contumil, Porto - Campanhã, Porto - São Bento |
number | results to be filtered | ||||||||||||||||||||||||||
15506 | Marco de Canaveses | Livração | Recesinhos | Vila Meã | Oliveira | Caíde | Meinedo | Bustelo | Penafiel | Paredes | Cête | Recarei-Sobreira | Valongo | Suzão | Ermesinde | Águas Santas/ Palmilheira | Rio Tinto | Contumil | Porto - Campanhã | Porto - São Bento | |||||||
15402 | Penafiel | Paredes | Oleiros | Irivo | Cête | Parada | Recarei-Sobreira | Trancoso | Terronhas | São Martinho do Campo | Valongo | Suzão | Cabeda | Ermesinde | Águas Santas/ Palmilheira | Rio Tinto | Contumil | Porto - Campanhã | Porto - São Bento | ||||||||
15508 | Marco de Canaveses | Livração | Vila Meã | Caíde | Meinedo | Penafiel | Paredes | Cête | Recarei-Sobreira | Valongo | Suzão | Ermesinde | Águas Santas/ Palmilheira | Rio Tinto | Contumil | Porto - Campanhã | Porto - São Bento | ||||||||||
15404 | Penafiel | Paredes | Oleiros | Irivo | Cête | Parada | Recarei-Sobreira | Trancoso | Terronhas | São Martinho do Campo | Valongo | Suzão | Cabeda | Ermesinde | Águas Santas/ Palmilheira | Rio Tinto | Contumil | Porto - Campanhã | Porto - São Bento |
=LET(filter,TEXTJOIN(",",,FILTER(Folha2!B2:AB5,Folha2!A2:A5=Folha1!B1)),after,LEFT(filter,FIND(B2,filter)-1),textafter,TEXTAFTER(filter,after),before,FIND(B3,filter),textbefore,RIGHT(filter,LEN(filter)-before-LEN(B3)+1),TEXTBEFORE(textafter,textbefore))
You can try this formula.
Folha1:
Folha2:
=TEXTVOR(TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1));RECHTS(TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1));LÄNGE(TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1)))-FINDEN(B3;TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1)))-LÄNGE(B3)+1))
Alternatively you can try this formula which is in cell B7 of sheet "Folha1". I didn't translate this formula because of it's lenght.
- OliverScheurichGold Contributor
=LET(filter,TEXTJOIN(",",,FILTER(Folha2!B2:AB5,Folha2!A2:A5=Folha1!B1)),after,LEFT(filter,FIND(B2,filter)-1),textafter,TEXTAFTER(filter,after),before,FIND(B3,filter),textbefore,RIGHT(filter,LEN(filter)-before-LEN(B3)+1),TEXTBEFORE(textafter,textbefore))
You can try this formula.
Folha1:
Folha2:
=TEXTVOR(TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1));RECHTS(TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1));LÄNGE(TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1)))-FINDEN(B3;TEXTNACH(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));LINKS(TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1));FINDEN(B2;TEXTVERKETTEN(",";;FILTER(Folha2!B2:AB5;Folha2!A2:A5=Folha1!B1)))-1)))-LÄNGE(B3)+1))
Alternatively you can try this formula which is in cell B7 of sheet "Folha1". I didn't translate this formula because of it's lenght.
- Pedro_DuarteCopper Contributor
Thank you, i had to adjust some cells (bold) but it worked like a charm.
=LET(filter;UNIRTEXTO(",";;FILTRAR(Folha2!B:AB;Folha2!A:A=Folha1!C4));after;ESQUERDA(filter;LOCALIZAR(F3;filter)-1);textafter;TEXTODEPOIS(filter;after);before;LOCALIZAR(F4;filter);textbefore;DIREITA(filter;NÚM.CARAT(filter)-before-NÚM.CARAT(F4)+1);TEXTOANTES(textafter;textbefore))