Skip i'r prif gynnwys

Sut i wahanu testun a rhifau o un gell yn ddwy golofn?

Os oes gennych golofn o dannau testun sy'n cynnwys testun a rhifau, nawr, hoffech chi wahanu'r testun a'r rhifau o un gell yn ddwy gell wahanol fel y dangosir y screenshot canlynol. Yn Excel, gallwch chi orffen y dasg hon gyda'r dulliau hyn.


Dull 1: Testun a rhifau ar wahân gyda fformwlâu yn Excel

Gyda'r fformwlâu canlynol, gallwch echdynnu'r testun a'r rhifau o'r gell yn ddwy gell sydd wedi'u gwahanu. Gwnewch fel a ganlyn:

1. Rhowch y fformiwla hon mewn cell wag - C3 lle rydych chi am roi'r canlyniad: =LEFT(A3,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A3&"0123456789"))-1), (A3 yw'r gell sy'n cynnwys y llinyn testun rydych chi am ei wahanu), ac yna pwyswch Rhowch allwedd i gael y testun yn unig o'r gell A2. Gweler y screenshot:

rhaniad doc rhif 2

2. Ac yna gallwch chi dynnu'r rhifau o'r gell trwy gymhwyso'r fformiwla hon: =DE(A3, LEN(A3)-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A3&"0123456789"))+1),( A3 yw'r gell sy'n cynnwys y llinyn testun rydych chi am ei wahanu), rhowch y fformiwla hon i mewn i gell D3 yr ydych chi am roi'r rhifau arni, a gwasgwch Rhowch allwedd, yna fe gewch y rhifau fel hyn:

rhaniad doc rhif 3

3. Yna dewiswch gell C3: D3, a llusgwch y handlen llenwi i'r celloedd rydych chi am gynnwys y fformwlâu hyn, a gallwch weld bod y testun a'r rhifau wedi'u gwahanu i wahanol gelloedd:

rhaniad doc rhif 4


Rhannu llinynnau testun ar wahân i golofnau testun a rhif unigol:

Kutools ar gyfer Excel's Celloedd Hollt mae nodwedd yn offeryn pwerus, gall eich helpu i rannu gwerthoedd celloedd yn golofnau neu resi lluosog, gall hefyd eich helpu i hollti llinynnau alffaniwmerig yn golofnau testun a rhifau wedi'u gwahanu, ac ati… Cliciwch i lawrlwytho Kutools ar gyfer Excel!

rhaniad doc rhif 16

Dull 2: Testun a rhifau ar wahân gyda Flash Llenwch yn Excel 2013 a fersiwn ddiweddarach

Gyda'r fformwlâu uchod, gallwch chi wahanu'r testun a'r rhifau os yw'r testun cyn y rhifau. I wahanu'r llinyn testun pa rif sydd cyn y testun, gallwch ddefnyddio'r Llenwch Flash nodwedd o Excel 2013 a fersiwn ddiweddarach.

Os oes gennych Excel 2013 a fersiwn ddiweddarach, bydd y Llenwch Flash gall nodwedd eich helpu i lenwi'r testun mewn un golofn a rhifau mewn colofn arall, gwnewch fel hyn:

1. Teipiwch rifau eich llinyn testun cyntaf yn llwyr i gell wag gyfagos - B3, gweler y screenshot:

rhaniad doc rhif 5

2. Ac yna dewiswch yr ystod B3: B7 lle rydych chi am lenwi'r rhifau, a chlicio Dyddiad > Llenwch Flash, a dim ond y niferoedd sydd wedi'u llenwi yn y celloedd ar unwaith, gweler y screenshot:

rhaniad doc rhif 6

3. Yna rhowch y llinyn testun yn gyfan gwbl i gell C3, gweler y screenshot:

rhaniad doc rhif 7

4. A dewiswch yr ystod gell C3: C7 lle rydych chi am lenwi'r testun yn unig, cliciwch Dyddiad > Llenwch Flash yn ogystal â cham 2, a gallwch weld, mae'r testun wedi'i wahanu fel a ganlyn:

rhaniad doc rhif 8

Tip: Gallwch hefyd lusgo'r handlen wedi'i llenwi i'r ystod rydych chi am ei defnyddio, ac yna cliciwch Opsiwn Llenwi Auto a gwirio Llenwch Flash.

rhaniad doc rhif 9

Dull 3: Testun a rhifau ar wahân sy'n gymysg yn afreolaidd â Swyddogaeth Diffiniedig y Defnyddiwr

Os oes gennych rywfaint o linyn testun sy'n destun cymysg a rhifau yn afreolaidd fel dilyn data a ddangosir, nid yw Excel yn cefnogi'r nodwedd gyffredinol i ddatrys y broblem hon, ond, gallwch greu Swyddogaeth Diffiniedig Defnyddiwr i orffen hyn.

rhaniad doc rhif 17

1. Daliwch i lawr y ALT + F11 allweddi i agor y Ffenestr Microsoft Visual Basic for Applications.

2. Cliciwch Mewnosod > Modiwlau, a gludwch y cod canlynol yn y Ffenestr Modiwl.

Cod VBA: testun a rhifau ar wahân i wahanol gelloedd i un gell

Public Function SplitText(pWorkRng As Range, pIsNumber As Boolean) As String
'Updateby Extendoffice
Dim xLen As Long
Dim xStr As String
xLen = VBA.Len(pWorkRng.Value)
For i = 1 To xLen
    xStr = VBA.Mid(pWorkRng.Value, i, 1)
    If ((VBA.IsNumeric(xStr) And pIsNumber) Or (Not (VBA.IsNumeric(xStr)) And Not (pIsNumber))) Then
        SplitText = SplitText + xStr
    End If
Next
End Function

3. Yna arbed a chau'r cod hwn, ewch yn ôl i'r daflen waith, nodwch y fformiwla hon = SplitText (A3, ANWIR) i mewn i gell wag i gael yr unig linyn testun ac yna llusgwch y ddolen llenwi i lawr i'r celloedd rydych chi am lenwi'r fformiwla hon, gweler y screenshot:

rhaniad doc rhif 10

4. Ac thne, fformiwla math = SplitText (A3, GWIR) i mewn i gell arall a llusgwch y ddolen llenwi i lawr i'r celloedd rydych chi am lenwi'r fformiwla hon i gael y rhifau, gweler y screenshot:

rhaniad doc rhif 11

Nodyn: Bydd y canlyniad yn anghywir os oes rhifau degol yn y llinyn testun.


Dull 4: Gwahanwch destun a rhifau yn ddwy golofn gyda Kutools ar gyfer Excel

Os oes gennych Kutools ar gyfer Excel, gyda'i offeryn pwerus- Celloedd Hollt cyfleustodau, gallwch chi rannu'r tannau testun yn ddwy golofn yn gyflym: un yw rhif, ac un arall yw testun.

Ar ôl gosod Kutools ar gyfer Excel, gwnewch fel a ganlyn:

1. Dewiswch yr ystod ddata rydych chi am wahanu'r testun a'r rhif.

2. Yna cliciwch Kutools > Uno a Hollti > Celloedd Hollt, gweler y screenshot:

3. Yn y Celloedd Hollt blwch deialog, dewiswch Hollti i Golofnau opsiwn o dan y math adran, ac yna gwirio Testun a rhif oddi wrth y Wedi'i rannu gan adran, gweler y screenshot:

rhaniad doc rhif 13

4. Yna cliciwch Ok botwm, a bydd blwch prydlon yn popio allan i'ch atgoffa i ddewis cell i allbwn y canlyniad, gweler y screenshot:

rhaniad doc rhif 14

5. Cliciwch OK botwm, ac mae'r tannau testun yn y detholiad wedi'u rhannu'n ddwy golofn fel y dangosir y screenshot canlynol:

rhaniad doc rhif 15

Cliciwch Lawrlwythwch Kutools ar gyfer Excel a threial am ddim Nawr!


Testun a rhifau ar wahân gyda Kutools ar gyfer Excel

Kutools ar gyfer Excel: gyda mwy na 300 o ychwanegiadau Excel defnyddiol, am ddim i geisio heb unrhyw gyfyngiad mewn 30 diwrnod. Dadlwythwch a threial am ddim Nawr!

Erthyglau cysylltiedig:

Sut i rannu gair yn lythrennau ar wahân yn Excel?

Sut i rannu celloedd yn golofnau neu resi lluosog trwy ddychwelyd cerbyd?


 

  • Kutools ar gyfer Excel: 300 + nodweddion defnyddiol ar gyfer Excel o dreial am ddim

    Gan gasglu mwy na 300 o offer craff a phroffesiynol ar gyfer Excel, mae'n symleiddio gwahanol fathau o dasgau cymhleth yn ychydig o gliciau yn eich gwaith bob dydd, a all arbed llawer o amser a chynyddu cynhyrchiant.

    • Cyfuno taflen waith neu lyfrau gwaith lluosog yn un llyfr gwaith neu daflen waith
    • Cyfrif a symio celloedd yn seiliedig ar gefndir, ffont neu liw fformatio amodol
    • Anfonwch yr un e-bost at restr o dderbynwyr yn unigol gyda gwahanol atodiadau
    • 110,000+ dewis defnyddwyr Excel. Treial llawn am ddim nodwedd 30 diwrnod, nid oes angen cerdyn credyd!
    • Gwarant arian yn ôl 60 diwrnod!
    citools 1 kutools plws
  • Cyfunwch nifer o daflenni gwaith neu lyfrau gwaith yn un ddalen neu lyfr gwaith

    Yn eich gwaith beunyddiol, gallai uno nifer o daflenni gwaith neu lyfrau gwaith yn un ddalen neu lyfr gwaith fod yn waith enfawr i chi eu cyfuno fesul un. Ond, gyda Kutools ar gyfer Excel's Cyfunwch nodwedd, gallwch ddatrys y dasg hon gyda dim ond sawl clic.

    cyfuno taflenni
  • Cyfrif a symio celloedd yn seiliedig ar gefndir, ffont neu liw fformatio amodol

    Efallai y bydd yn dasg anodd ichi gyfrif neu grynhoi gwerthoedd y gell yn seiliedig ar gefndir, ffont neu liw fformatio amodol mewn ystod fawr, Kutools ar gyfer Excel yn cefnogi teclyn hawdd-Cyfrif yn ôl Lliw a all eich helpu i ddelio â'r swydd hon cyn gynted â phosibl heb unrhyw sgiliau Excel.

    cyfrif yn ôl lliw
  • Anfonwch yr un e-bost at restr o dderbynwyr yn unigol gyda gwahanol atodiadau

    Gallwch gymhwyso'r cais Word i anfon e-byst wedi'u personoli at sawl person heb atodiadau, ond, Gyda Kutools ar gyfer Excel's Anfon E-byst nodwedd, gellir cywiro'r cyfyngiad hwn. Ar yr un pryd, gallwch CC neu Bcc y negeseuon i berson penodol hefyd.

    anfon e-byst

 

Comments (34)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Tenho uma coluna com vários endereços e os números de endereços. Conforme tabela abaixo. Como separo em uma coluna apenas os nomes e outra coluna apenas os números?

endereço
Avenida Angélica 1235
Rua José Maria Lisboa 456
Rua Celso de Azevedo Marques 307
Rua Rio Duas Barras 953
This comment was minimized by the moderator on the site
Hello, Mateus,
To extract the address number only from the address, the folloiwng formula may help you:
=SUMPRODUCT(MID(0&B3, LARGE(INDEX(ISNUMBER(--MID(B3, ROW(INDIRECT("1:"&LEN(B3))), 1)) * ROW(INDIRECT("1:"&LEN(B3))), 0), ROW(INDIRECT("1:"&LEN(B3))))+1, 1) * 10^ROW(INDIRECT("1:"&LEN(B3)))/10)

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Bom dia.
Consegui extrair o número, muito obrigado!
Mas como eu consigo extrair agora apenas o endereço?
This comment was minimized by the moderator on the site
Hello, Mateus,
If you want to extract both address and address number, you can apply the Method 3 in this article:

https://www.extendoffice.com/documents/excel/2701-excel-separate-text-and-numbers.html#a3

After copying and pasting the code, please apply the below formulas:
Extract address: =SplitText(B2,FALSE)

Extract address number: =SplitText(B2,TRUE)
Please try, hope it can help you! If you have any other problem, please comment here.
This comment was minimized by the moderator on the site
Agile (11/20/2017 12:00:00 AM)How can I separate this cell into just "Agile" and "(11/20/2017 12:00:00 AM)"
This comment was minimized by the moderator on the site
Hello, Milner,To get the name text, please use this formula: =TRIM(LEFT(A1, FIND("(", A1)-1))To get the date time, please apply this formula: =MID(A1,SEARCH("(",A1),SEARCH(")",A1)-SEARCH("(",A1)+1)Please try the formulas, hope them can help you!
This comment was minimized by the moderator on the site
0002786961 TRAK CDFA #: 0008787942 2722 2723 4536841 N/A 4345784 001018809~00077480

Above is an example of data line I need to split these into 3 types: First: starts with 2 and is of 4 digit (2722 in above example) Second: starts with 2 and is of 7 digit third; starts with 4 is of 7 digit.
I tried separating everything into different columns and then putting if and conditions that I mentioned above but the problem is not everything is getting separated and splitting everything is not efficient enough. I am not able to figure out a vba code for something that satisfies all the conditions and works too.
Can anyone help me out?
This comment was minimized by the moderator on the site
Hello, menze
Do you need to split this three parts 2722 2723 4536841 from the long data? If so, you just can use the Text to Column feature in Excel to split the content into multiple cells by space, then delete the extra data and only keep the data you need.
If not, please upload your Excel file or screenshot here for a reference.
Thank you!
This comment was minimized by the moderator on the site
I have a requirement code that I need to separate out from the text, looks like this 3.1.1.2. Line-of-sight Range Requirements (T=O) The vehicle and units shall be capable of line-of-sight connectivity to all nodes or within a 10-mile radius, whichever is greater. In one column I need the code and the other I need the text. Can you help?
This comment was minimized by the moderator on the site
I have address like 12,anna street,98413256789 i want to seperate address and contact number(mobile or landline) two columns. Is it possible.Pls help to solve
This comment was minimized by the moderator on the site
Hi, Mohan,To seperate address and contact number, please apply the below formulas:Address: =LEFT(A1,LEN(A1)-12)Mobile number: =RIGHT(A1,11)
Please try, hope it can help you!
This comment was minimized by the moderator on the site
Please, help me with the VBA code required to take out "INC000010542805" out of "User KSmith Audit ID INC000010542805 Comment None Control Data".
I have 1,000 rows of this type of data with different number of characters but always with that "INC" string.
This comment was minimized by the moderator on the site
Hello, Kenny,
May be the below formula can solve your problem, please try:
=TRIM(LEFT(SUBSTITUTE(MID(A1,FIND("INC",A1),LEN(A1))," ",REPT(" ",100)),100))
This comment was minimized by the moderator on the site
skyyang thanks very much, it works. I really appreciate your help
This comment was minimized by the moderator on the site
how to separate number and letters (1122AB). I tried the upper formula but its not working with me. anybody help me in this regard. Thanks in advance
This comment was minimized by the moderator on the site
Hello, Naeem,
The above formula only works if the text is before the numbers, your numbers before the text, so i recommend the second and third method for you!
Please try, hope it can help you!
This comment was minimized by the moderator on the site
kereeeennn... berhasil....
This comment was minimized by the moderator on the site
Thanks worked for Alpha-numeric cell data [ =RIGHT(A2,LEN(A2)-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"))+1)]
This comment was minimized by the moderator on the site
Hello Can anyone help me? I want to remove this zero and braceket by an excel formula.
1 BR PE-0.50CT(H SI2)- -0.00( )-2 SP PE-0.50CT(H SI1)-1 RU PE-0.40CT(H-SI)-750GF-RG-RING-25-40-2.50GM


Gowtam
This comment was minimized by the moderator on the site
VERY USEFUL FORMULA I LIKE IT.
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