Ir para o conteúdo principal

Como extrair string entre dois caracteres diferentes no Excel?

Se você tem uma lista de string no Excel da qual precisa extrair parte da string entre dois caracteres da imagem abaixo mostrada, como lidar com isso o mais rápido possível? Aqui, apresento alguns métodos para resolver esse trabalho.

Extraia a string parcial entre dois caracteres diferentes com fórmulas

Extraia parte da string entre dois mesmos caracteres com fórmulas

Extraia uma string parcial entre dois caracteres com o Kutools para Excelboa ideia 3


Extraia a string parcial entre dois caracteres diferentes com fórmulas

Para extrair parte da string entre dois caracteres diferentes, você pode fazer o seguinte:

Selecione uma célula na qual você colocará o resultado, digite esta fórmula =MID(LEFT(A1,FIND(">",A1)-1),FIND("<",A1)+1,LEN(A1))e pressione Enter chave.
doc extrair string entre dois caracteres 1

Note: A1 é a célula de texto, > e < são os dois caracteres entre os quais você deseja extrair a string.


Extraia parte da string entre dois mesmos caracteres com fórmulas

Se você deseja extrair parte da string entre dois mesmos caracteres, pode fazer o seguinte:

Selecione uma célula na qual você colocará o resultado, digite esta fórmula =SUBSTITUTE(MID(SUBSTITUTE("/" & A3&REPT(" ",6),"/",REPT(",",255)),2*255,255),",","")e pressione Enter chave.
doc extrair string entre dois caracteres 2

Nota: A3 é a célula de texto, / é o caractere que você deseja extrair.

Extraia uma string parcial entre dois caracteres com o Kutools para Excel

Se você tem Kutools for Excel, você também pode extrair parte da string entre dois textos.

Kutools for Excel, com mais de 300 funções úteis, tornam seus trabalhos mais fáceis. 

Depois de instalar Kutools para Excel, faça o seguinte:(Baixe gratuitamente o Kutools para Excel agora!)

1. Selecione uma célula que colocará a string extraída e clique em Kutools > Fórmula > Fórmula Helper.
doc extrair string entre dois caracteres 3

2. No Fórmula Helper diálogo, .check filtros caixa de seleção e digite "ex" na caixa de texto, todas as fórmulas sobre a extração serão listadas em Escolha uma fórmula seção, escolha Extraia strings entre o texto especificado, então vá para a direita Entrada de argumentos seção, selecione a célula da qual deseja extrair a substring para Célulae digite os dois textos entre os quais deseja extrair.
doc kutools extrai string entre dois textos 2

3. Clique Ok, então a substring entre dois textos que você especificou foi extraída, arraste a alça de preenchimento para baixo para extrair a subtring de cada célula abaixo.
doc kutools extrai string entre dois textos 3

doc kutools extrai string entre dois textos 4

Melhores ferramentas de produtividade de escritório

🤖 Assistente de IA do Kutools: Revolucionar a análise de dados com base em: Execução Inteligente   |  Gerar Código  |  Crie fórmulas personalizadas  |  Analise dados e gere gráficos  |  Invocar funções do Kutools...
Recursos mais comuns: Encontre, destaque ou identifique duplicatas   |  Excluir linhas em branco   |  Combine colunas ou células sem perder dados   |   Rodada sem Fórmula ...
Super pesquisa: VLookup de múltiplos critérios    VLookup de múltiplos valores  |   VLookup em várias planilhas   |   Pesquisa Difusa ....
Lista suspensa avançada: Crie rapidamente uma lista suspensa   |  Lista suspensa de dependentes   |  Lista suspensa de seleção múltipla ....
Gerenciador de colunas: Adicione um número específico de colunas  |  Mover colunas  |  Alternar status de visibilidade de colunas ocultas  |  Compare intervalos e colunas ...
Recursos em destaque: Foco da Grade   |  Vista de Design   |   Grande Barra de Fórmula    Gerenciador de pastas de trabalho e planilhas   |  Biblioteca (Auto texto)   |  Data Picker   |  Combinar planilhas   |  Criptografar/Descriptografar Células    Enviar e-mails por lista   |  Super Filtro   |   Filtro Especial (filtro negrito/itálico/tachado...) ...
15 principais conjuntos de ferramentas12 Texto Ferramentas (Adicionar texto, Remover Personagens, ...)   |   50+ de cores Tipos (Gráfico de Gantt, ...)   |   Mais de 40 práticos Fórmulas (Calcule a idade com base no aniversário, ...)   |   19 Inclusão Ferramentas (Insira o código QR, Inserir imagem do caminho, ...)   |   12 Conversão Ferramentas (Números para Palavras, Conversão de moedas, ...)   |   7 Unir e dividir Ferramentas (Combinar linhas avançadas, Dividir células, ...)   |   ... e mais

Aprimore suas habilidades de Excel com o Kutools para Excel e experimente uma eficiência como nunca antes. Kutools para Excel oferece mais de 300 recursos avançados para aumentar a produtividade e economizar tempo.  Clique aqui para obter o recurso que você mais precisa...

Descrição


Office Tab traz interface com guias para o Office e torna seu trabalho muito mais fácil

  • Habilite a edição e leitura com guias em Word, Excel, PowerPoint, Publisher, Access, Visio e Project.
  • Abra e crie vários documentos em novas guias da mesma janela, em vez de em novas janelas.
  • Aumenta sua produtividade em 50% e reduz centenas de cliques do mouse para você todos os dias!
Comments (35)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Bonjour,

je souhaite extraire de ce texte (USD) 934.915765 (30-11-2022) le numero 934.915765, ce que je souhaite c'est faire un extrait de tout ce qui est entre (USD) et (30-11-2022)
This comment was minimized by the moderator on the site
Hi, please try this formula:
=LEFT((MID(I1,FIND(" ",I1)+1,256)),FIND(" ",(MID(I1,FIND(" ",I1)+1,256)),1)-1)
I1 is the cell that you want to extract number.
This comment was minimized by the moderator on the site
Hi, try this formula please:
=IFERROR(MID(A1,FIND("CG",A1),11),IFERROR(MID(A1,FIND("CP",A1),11),IFERROR(MID(A1,FIND("CV",A1),11),IFERROR(MID(A1,FIND("CD",A1),11),IFERROR(MID(A1,FIND("CC",A1),11),MID(A1,FIND("CO",A1),11))))))

If there is no match string, it returns #VALUE! error.
This comment was minimized by the moderator on the site
Hello, can you please help me with extracting a code from a cell? The code is always 11 characters long and it can start with either CC, CP, CV, CO, CG or CD. If it helps, it also ends with a number always. The code does not have a fixed position, it can be in the beginning, middle or end.
I tried this formula =MID(A2,FIND("CP",A2),11) but, as you see, it only finds the ones starting with CP.

An example of what the cell might contain is:
Text text CG1234dh201 text 123 text

Thank you!
This comment was minimized by the moderator on the site
Hi, I have an issue which i am struggling to solve. So I have a number of answers and i want to separate into separate cells.

i.e. A: XYZ|B*: SDR|C: AQS|

I can separate but my issue is there loads of line with the asterisk moving to the correct answer for each question. How do i get my head around this?

I am currently using the below formula

=MID(A5,SEARCH("A:",cell ref)+2,SEARCH("|",A5)-SEARCH(":",cell ref)-1)
This comment was minimized by the moderator on the site
Hi, Mohannmed Faisal, from my understanding, your question is to extract XYZ, SDR and AQS separately into three cells. If so, please use formulas below separately:
=MID(A7,SEARCH("A:",A7)+3,3)
=MID(A7,SEARCH("B*:",A7)+4,3)
=MID(A7,SEARCH("|C:",A7)+4,3)
A7 is the cell that you use to extract.
Hope it help you.
This comment was minimized by the moderator on the site
Bonjour,

J'ai un texte AAMMJJ que je souhaite transformer en JJMMAAAA
This comment was minimized by the moderator on the site
Hi, GG, try this formula =TEXTE(date; "jj/mm/aaaa")
This comment was minimized by the moderator on the site
Hi How to get specific value from description like
Desc: Date: 2022-07-22 23:59:51 Node: VA10TWPSQL026 Type: TSM SM_SERVER_EVENT 2579 Resource: 1700 Message Key: TSM_VA10TWPSQL026

I want to get node value as VA10TWPSQL026
This comment was minimized by the moderator on the site
Hi, Sandhya, if the node value always has a fixed length (14-chars), you can try this formula: =MID(A1,SEARCH("Node",A1)+5,14) hope it do a favor for you.
This comment was minimized by the moderator on the site
Hola,

Me encantan tus foros.

Me podrias ayudar con esto?

Tengo una serie de columnas asi:

U CALIPER R/H/R 1J0615424H Es
N DOOR WINDOW SWITCH R/H/F 8E0959851D5PR Ebbett Audi
N TAILIGHT L/H - LENS & BODY - ON QTR - W/XENON H/LAMP 63217217311 Coombes Johnson European Ltd
U*GUARD R/H/F - REPLACE RET NUT ALSO 5G0821106A (V) Private Purchase

Lo que necesito extraer es el numero de parte de cada celda pero siempre esta en una posicion diferente, por ejemplo de la primer celda necesito solo 1J0615424H, de la segunda necesito extraer 8E0959851D5PR, de la tercera 63217217311 y de la ultima 5G0821106A

Muchas gracias

Anderson
This comment was minimized by the moderator on the site
Hallo,

Ik moet een stuk tekst extraheren uit een cel, maar kom er niet aan uit.

51420647 Ondersteuner Kringdirectie (Unfilled)
P_00040501 Productmanager Wendbare Pool Bedrijven (Unfilled)

De tekst die ik nodig heb ik is het middelste deel tussen de cijfers en (unfilled).
Welke formuler kan ik hiervoor gebruiken?
This comment was minimized by the moderator on the site
HelloI have an issue where I am trying to extract a number from a set of text and numbers in excel. This is an excerpt from the data I have:AUS23-7W
GER490-8W
MEX114-2M
MEX444-5M
MEX331-3W
US118-15W
ARG572-16W
Japan122-6W
Japan526-13W
ARG585-7W
Japan398-16W
Japan320-15W
ARG141-3Mo
Canada329-5W
US421-17Mo
Canada427-14W
I need to be able to extract just the number to the right of the dash. For example, I need Japan320-15W to return just the 15 in its own column. Is there a formula you could provide me with that can accomplish this? Many thanks!

This comment was minimized by the moderator on the site
Hello, Duggled, to solve your job, just need two steps. Firstly, select the text strings, and apply Text to Columns under Data tab, choose Delimited > Other, and type - into the textbox beside Other option, click Finish. In this step, your data has been split into two columns by deliliter -. Secondly, use the formula  =SUMPRODUCT(MID(0&B1, LARGE(INDEX(ISNUMBER(--MID(B1, ROW(INDIRECT("1:"&LEN(B1))), 1)) * ROW(INDIRECT("1:"&LEN(B1))), 0), ROW(INDIRECT("1:"&LEN(B1))))+1, 1) * 10^ROW(INDIRECT("1:"&LEN(B1)))/10)(A1 is the cell that you want to extract the number from, here you change it to your second column cell)then the numbers after - have been extracted. Or in the second step, you can apply VBA, or our handy tool, for more details, please visit:https://www.extendoffice.com/documents/excel/1622-excel-extract-number-from-string.html
This comment was minimized by the moderator on the site
This formula works well for pretty much everything except these data :MEX114-2M
MEX444-5M
MEX373-15M
MEX540-8M
MEX396-11M
MEX386-10M
MEX369-14M
MEX446-3M
MEX75-12M
MEX372-3M
MEX178-6M
MEX510-7M
MEX361-17M
MEX501-13M
MEX221-17M
Is there any way you could revise that formula to include these? Thank you so much!
This comment was minimized by the moderator on the site
Hi! Sorry if I reposted this and thank you so much for the formula.
But I'm not sure how to do this, I have this in a cell:

random comment;24/nov/21 2:34 PM;random ID;3240

and I need to get in separate cells the date without the hour, like 24/nov/21 . And, in another cell, the last numer; in this case 3240 (The format is alway the same, and the date is always 9 characters long, the only thing that might change is the last number, as is the number of seconds it took to do something)

How should I do it?
Thank you!! 
This comment was minimized by the moderator on the site
Hi, to extract date, please use formula =MID(A1,16,9), A1 is the cell that the original data places, to extract ID number, please use formula =MID(A1,44,10),, for more details, you can refer to this articel https://www.extendoffice.com/documents/excel/3639-excel-extract-part-of-string.html
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations