メインコンテンツへスキップ

テキストと数字をXNUMXつのセルからXNUMXつの列に分ける方法は?

テキストと数字で構成されるテキスト文字列の列がある場合は、次のスクリーンショットに示すように、XNUMXつのセルのテキストと数字をXNUMXつの異なるセルに分割します。 Excelでは、これらの方法でこのタスクを完了することができます。


方法1:Excelの数式でテキストと数値を区切る

次の数式を使用すると、セルからテキストと数字をXNUMXつの別々のセルに抽出できます。 次のようにしてください。

1。 結果を配置する空白のセル–C3にこの数式を入力します。 = LEFT(A3、MIN(FIND(0,1,2,3,4,5,6,7,8,9 {}、A3& "0123456789"))-1)(以下、A3 分離するテキスト文字列を含むセルです)、を押します 入力します セルA2からテキストのみを取得するためのキー。 スクリーンショットを参照してください:

ドキュメント分割テキスト番号2

2.次に、次の数式を適用して、セルから数値を抽出できます。 = RIGHT(A3、LEN(A3)-MIN(FIND(0,1,2,3,4,5,6,7,8,9 {}、A3& "0123456789"))+ 1),( A3 は、分離するテキスト文字列を含むセルです)、数値を配置するセルD3にこの数式を入力し、を押します。 入力します キーを押すと、次のように数字が表示されます。

ドキュメント分割テキスト番号3

3。 次に、セルC3:D3を選択し、これらの数式を含めるセルに塗りつぶしハンドルをドラッグすると、テキストと数値が異なるセルに分割されていることがわかります。

ドキュメント分割テキスト番号4


テキスト文字列を個々のテキスト列と数値列に分割または分割します。

Kutools for Excel's 分割セル この機能は強力なツールであり、セル値を複数の列または行に分割するのに役立ちます。また、英数字の文字列をテキストと数値の列に分割するのにも役立ちます。 クリックしてKutoolsfor Excelをダウンロードしてください!

ドキュメント分割テキスト番号16

方法2:Excel2013以降のバージョンのFlashFillでテキストと数字を区切る

上記の数式では、テキストが数字の前にある場合は、テキストと数字を区切ることができます。 テキストの前にある番号のテキスト文字列を区切るには、 フラッシュフィル Excel2013以降のバージョンの機能。

Excel 2013以降のバージョンを使用している場合、 フラッシュフィル 機能は、ある列にテキストを入力し、別の列に数字を入力するのに役立つ場合があります。次のようにしてください。

1。 最初のテキスト文字列の番号を隣接する空白のセル(B3)に完全に入力します。スクリーンショットを参照してください。

ドキュメント分割テキスト番号5

2。 次に、数字を入力する範囲B3:B7を選択し、[ 且つ > フラッシュフィル、および数字のみが一度にセルに入力されています。スクリーンショットを参照してください。

ドキュメント分割テキスト番号6

3。 次に、テキスト文字列をセルC3に完全に入力します。スクリーンショットを参照してください。

ドキュメント分割テキスト番号7

4. そして、テキストのみを入力するセル範囲C3:C7を選択し、をクリックします。 且つ > フラッシュフィル 手順2と同様に、テキストは次のように区切られています。

ドキュメント分割テキスト番号8

先端:塗りつぶしたハンドルを使用する範囲にドラッグして、クリックすることもできます 自動入力オプション チェック フラッシュフィル.

ドキュメント分割テキスト番号9

方法3:ユーザー定義関数と不規則に混在するテキストと数字を分離する

次のデータのように、テキストと数字が不規則に混在するテキスト文字列がある場合、Excelはこの問題を解決する一般的な機能をサポートしていませんが、ユーザー定義関数を作成してこれを完了することができます。

ドキュメント分割テキスト番号17

1。 を押し続けます Alt + F11 キーを押して Microsoft Visual Basic forApplicationsウィンドウ.

2に設定します。 OK をクリックします。 インセット > モジュール、次のコードをに貼り付けます モジュールウィンドウ.

VBAコード:テキストと数字をXNUMXつのセルから異なるセルに分割する

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。 次に、このコードを保存して閉じ、ワークシートに戻り、この数式を入力します = SplitText(A3、FALSE) 空白のセルに入力してテキスト文字列のみを取得し、塗りつぶしハンドルをこの数式に入力するセルまでドラッグします。スクリーンショットを参照してください。

ドキュメント分割テキスト番号10

4。 そして、数式を入力します = SplitText(A3、TRUE) 別のセルに入力し、この数式に入力するセルまで塗りつぶしハンドルをドラッグして数値を取得します。スクリーンショットを参照してください。

ドキュメント分割テキスト番号11

Note:テキスト文字列にXNUMX進数が含まれていると、結果が正しくなくなります。


方法4:Kutools for Excelを使用して、テキストと数値をXNUMXつの列に分割します

あなたが持っている場合 Kutools for Excel、その強力なツールで- 分割セル ユーティリティを使用すると、テキスト文字列をXNUMXつの列にすばやく分割できます。XNUMXつは数値で、もうXNUMXつはテキストです。

インストールした後 Kutools for Excel、次のようにしてください。

1。 テキストと数字を区切るデータ範囲を選択します。

2。 次に、をクリックします クツール > マージ&スプリット > 分割セル、スクリーンショットを参照してください:

3。 の中に 分割セル ダイアログボックスで 列に分割 オプションの下に タイプ セクション、そしてチェック テキストと番号 分割 セクション、スクリーンショットを参照してください:

ドキュメント分割テキスト番号13

4。 次に、をクリックします Ok ボタンをクリックすると、結果を出力するセルを選択するように促すプロンプトボックスが表示されます。スクリーンショットを参照してください。

ドキュメント分割テキスト番号14

5に設定します。 OK をクリックします。 OK 次のスクリーンショットに示すように、ボタンをクリックすると、選択範囲内のテキスト文字列がXNUMXつの列に分割されます。

ドキュメント分割テキスト番号15

[Kutools for Excelをダウンロードして今すぐ無料トライアル]をクリックしてください!


Kutools forExcelでテキストと数字を区切る

Kutools for Excel:300以上の便利なExcelアドインがあり、30日以内に制限なしで無料で試すことができます。 今すぐダウンロードして無料トライアル!

関連記事:

Excelで単語を別々の文字に分割する方法は?

キャリッジリターンでセルを複数の列または行に分割するにはどうすればよいですか?


 

  • Kutools for Excel:無料トライアルのExcel用の300以上の便利な機能

    Excel用の300以上のスマートでプロフェッショナルなツールを収集することで、さまざまな種類の複雑なタスクを日常業務の数回のクリックに簡素化し、時間を大幅に節約して生産性を向上させることができます。

    • 複数のワークシートまたはワークブックをXNUMXつのワークブックまたはワークシートに結合します
    • 背景、フォント、または条件付き書式の色に基づいてセルをカウントおよび合計します
    • 添付ファイルが異なる受信者のリストに同じメールを個別に送信する
    • 110,000人以上のExcelユーザーの選択。 30日間のフル機能の無料トライアル、クレジットカードは必要ありません!
    • 60日返金保証!
    クツール 1 クツールズプラス
  • 複数のワークシートまたはワークブックをXNUMXつのシートまたはワークブックに結合します

    日常業務では、複数のワークシートまたはワークブックをXNUMXつのシートまたはワークブックにマージすることは、それらをXNUMXつずつ組み合わせるのに非常に大きな作業になる場合があります。 しかし、 Kutools for Excel's 組み合わせる 機能を使用すると、数回クリックするだけでこのタスクを解決できます。

    シートを組み合わせる
  • 背景、フォント、または条件付き書式の色に基づいてセルをカウントおよび合計します

    広い範囲の背景、フォント、または条件付き書式の色に基づいてセル値をカウントまたは合計するのは難しい作業になる場合があります。 Kutools for Excel 簡単なツールをサポート-色で数える これは、Excelのスキルがなくても、この仕事にできるだけ早く対処するのに役立ちます。

    色で数える
  • 添付ファイルが異なる受信者のリストに同じメールを個別に送信する

    Wordアプリケーションを適用して、添付ファイルなしで複数の人にパーソナライズされた電子メールを送信できますが、 Kutools for Excel's メールを送る 機能、このlimatationは改善することができます。 同時に、特定の人へのメッセージをCCまたはBccで送信することもできます。

    メールを送る

 

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