Przejdź do głównej zawartości

Jak wyciągać lub wyodrębniać znaki od prawej do lewej w komórce, aż do osiągnięcia spacji w programie Excel?

W tym artykule omówiono wyciąganie lub wyodrębnianie znaków z prawej strony komórki, aż do osiągnięcia spacji, aby uzyskać następujący wynik w arkuszu programu Excel. Przydatna formuła w tym artykule może szybko i łatwo rozwiązać tę pracę.

Przeciągnij lub wyodrębnij znaki z prawej strony komórki, aż zostanie osiągnięta spacja za pomocą formuły


Przeciągnij lub wyodrębnij znaki z prawej strony komórki, aż zostanie osiągnięta spacja za pomocą formuły

Oto prosta formuła, która pomoże Ci wyodrębnić znaki z prawej strony komórki, aż spacja zostanie wypełniona, wykonaj następujące czynności:

Wprowadź tę formułę: = TRIM (RIGHT (SUBSTITUTE (A2; ""; REPT (""; 255)); 255)) do pustej komórki, w której chcesz uzyskać wynik, a następnie przeciągnij uchwyt wypełniania w dół do komórek, w których chcesz wypełnić tę formułę, a wszystkie znaki z prawej strony komórek podczas spotkania z pierwszą spacją są wyodrębniane jednocześnie, patrz zrzut ekranu:

Najlepsze narzędzia biurowe

🤖 Pomocnik AI Kutools: Zrewolucjonizuj analizę danych w oparciu o: Inteligentne wykonanie   |  Wygeneruj kod  |  Twórz niestandardowe formuły  |  Analizuj dane i generuj wykresy  |  Wywołaj funkcje Kutools...
Popularne funkcje: Znajdź, wyróżnij lub zidentyfikuj duplikaty   |  Usuń puste wiersze   |  Łącz kolumny lub komórki bez utraty danych   |   Okrągły bez wzoru ...
Super wyszukiwanie: Wiele kryteriów VLookup    Wiele wartości VLookup  |   Przeglądanie pionowe na wielu arkuszach   |   Wyszukiwanie rozmyte ....
Zaawansowana lista rozwijana: Szybko twórz listę rozwijaną   |  Zależna lista rozwijana   |  Lista rozwijana wielokrotnego wyboru ....
Menedżer kolumn: Dodaj określoną liczbę kolumn  |  Przesuń kolumny  |  Przełącz stan widoczności ukrytych kolumn  |  Porównaj zakresy i kolumny ...
Polecane funkcje: Fokus siatki   |  Widok projektu   |   Duży pasek formuły    Menedżer skoroszytów i arkuszy   |  Biblioteka zasobów (Automatyczny tekst)   |  Selektor dat   |  Połącz arkusze   |  Szyfruj/odszyfruj komórki    Wysyłaj e-maile według listy   |  Super filtr   |   Specjalny filtr (filtruj pogrubienie/kursywa/przekreślenie...) ...
15 najlepszych zestawów narzędzi12 Tekst Tools (Dodaj tekst, Usuń znaki, ...)   |   50 + Wykres rodzaje (Wykres Gantta, ...)   |   40+ Praktyczne Wzory (Oblicz wiek na podstawie urodzin, ...)   |   19 Wprowadzenie Tools (Wstaw kod QR, Wstaw obraz ze ścieżki, ...)   |   12 Konwersja Tools (Liczby na słowa, Przeliczanie walut, ...)   |   7 Połącz i podziel Tools (Zaawansowane wiersze łączenia, Podział komórki, ...)   |   ... i więcej

Zwiększ swoje umiejętności Excela dzięki Kutools for Excel i doświadcz wydajności jak nigdy dotąd. Kutools dla programu Excel oferuje ponad 300 zaawansowanych funkcji zwiększających produktywność i oszczędzających czas.  Kliknij tutaj, aby uzyskać funkcję, której najbardziej potrzebujesz...

Opis


Karta Office wprowadza interfejs z zakładkami do pakietu Office i znacznie ułatwia pracę

  • Włącz edycję i czytanie na kartach w programach Word, Excel, PowerPoint, Publisher, Access, Visio i Project.
  • Otwieraj i twórz wiele dokumentów w nowych kartach tego samego okna, a nie w nowych oknach.
  • Zwiększa produktywność o 50% i redukuje setki kliknięć myszką każdego dnia!
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This is a nice piece of formula,
I took liberty to change it and it worked for me.

Considering your data between two spaces is not more than 20 characters and you need data between spaces try this.

Original Formula for last space to end
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255))


Between 2nd last space and last space
=TRIM(LEFT(RIGHT(SUBSTITUTE(C1," ",REPT(" ",25)),50),25))


Between 3rd last space and 2nd last space

=TRIM(LEFT(RIGHT(SUBSTITUTE(C1," ",REPT(" ",25)),50),25))
This comment was minimized by the moderator on the site
si, solo tienes que cambiar el numero en negrella a 2 de la formula "=EXTRAE(A5;ENCONTRAR("@";SUSTITUIR(A5;" ";"@";LARGO(A5)-LARGO(SUSTITUIR(A5;" ";""))-1))+1;100)"
This comment was minimized by the moderator on the site
Hi, thanks so much for the help! Is there any way to do the same thing, but to pull out text from right to left until the THIRD space? It would save my life!!!!
This comment was minimized by the moderator on the site
Hello, santos
To extract the text from right to left until the THIRD space, please apply the below formula:
=IF((LEN(A1)-LEN(SUBSTITUTE(A1," ","")))<3, A1, RIGHT(A1,LEN(A1)-FIND("/", SUBSTITUTE(A1," ","/", (LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-2)))))


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
I am using a similar formula =TRIM(RIGHT(SUBSTITUTE(F7," ",REPT(" ",255)),255)) which is copying the word to G7, however I would like it to remove the word from F7. Are you able to assist me with what I need to adjust in my formula?
This comment was minimized by the moderator on the site
This is a great formula. I would love to understand the individual parts a bit better. Could someone provide a bit of a summary as to what each part is doing?
TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255))
This comment was minimized by the moderator on the site
Explanation of TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255))

TLDR: pad the space before the last character(s) on the right with 255 spaces, extract 255 characters from the right, then trim the space characters, leaving the desired non-text characters.

Long explanation:
1. REPT (Repeat) is adding 255 space characters. WHY? These added spaces will be inserted by SUBSTITUE.
2. SUBSTITUTE is replacing each space characters with 255 spaces (provided by REPT). WHY? This causes a cell to contain the desired characters on the right, plus 255 space characters to the left of the desired cell characters; this will be exploited by the RIGHT extraction function.
3. RIGHT is extracting the first 255 characters from the right. WHY? This extracts the desired characters on the right plus the added space characters (up to 255 characters) inserted by SUBSTITUTE.
4. TRIM is removing all space characters. WHY? This leaves only the desired characters on the right.


Caveat: This formula only works so long as the desired right text characters are <=255 characters. If the desired right text characters are >256, then the RIGHT function will miss the characters over 255.
This comment was minimized by the moderator on the site
Hi,
I had to put a Trim(A2) into mine as I had trailing blanks - otherwise works great.
This comment was minimized by the moderator on the site
Is there a way to extract and the result be read as a number? I am extracting the number part of an exported column that excel is reading as text. Thanks!
This comment was minimized by the moderator on the site
Hello, Russell,
If you need the result as number format, you should copy and paste the formula cells into other cells as values, and then convert the text format number to real number.
This comment was minimized by the moderator on the site
thanks a lot
This comment was minimized by the moderator on the site
This formula worked perfectly:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255))

Is there any way to do the same thing, but to pullout text from right to left untill the SECOND space?
This comment was minimized by the moderator on the site
Hi, Paulius,
To extract the text from right to left until the second space, you should apply the below formula:
=MID(A2,FIND("@",SUBSTITUTE(A2," ","@",LEN(A2)-LEN(SUBSTITUTE(A2," ",""))-1))+1,100)

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Thank you!!!!!!!!!!
This comment was minimized by the moderator on the site
Thank You it worked perfectly
This comment was minimized by the moderator on the site
Thank you so much! Saved me a ton of time!
This comment was minimized by the moderator on the site
This is close to what I need help with so I'm hoping someone can help. I need to pull over 20 characters or until the next space. how can I modify the formulas above to do that?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations