메인 컨텐츠로 가기

Excel의 텍스트 문자열에서만 숫자를 추출하는 방법은 무엇입니까?


방법 1 : 수식을 사용하여 텍스트 문자열에서만 숫자 추출

다음의 긴 공식은 텍스트 문자열에서 숫자 만 추출하는 데 도움이 될 수 있습니다. 다음과 같이하십시오.

추출 된 숫자를 출력 할 빈 셀을 선택한 다음 다음 공식을 입력합니다. = SUMPRODUCT (MID (0 & A5, LARGE (INDEX (ISNUMBER (-MID (A5, ROW (INDIRECT ( "1 :"& LEN (A5))), 1)) * ROW (INDIRECT ( "1 :"& LEN (A5)) )), 0), ROW (INDIRECT ( "1 :"& LEN (A5)))) + 1, 1) * 10 ^ ROW (INDIRECT ( "1 :"& LEN (A5))) / 10)을 클릭 한 다음 채우기 핸들을 끌어이 수식을 적용하는 데 필요한 범위를 채 웁니다. 스크린 샷보기 :

문서 추출 번호 만 2

배송 시 요청 사항:

  • 1. A5 목록에서만 숫자를 추출하려는 첫 번째 데이터를 의미합니다.
  • 2. 문자열에 숫자가 없으면 결과가 0으로 표시됩니다.

텍스트 문자열에서만 숫자 추출 :

Excel 용 Kutools 발췌 번호 함수를 사용하면 텍스트 문자열 셀에서 숫자 만 빠르게 추출 할 수 있습니다. Excel 용 Kutools를 다운로드하려면 클릭하십시오!

문서 추출 번호 만 14


방법 2 : VBA 코드를 사용하여 텍스트 문자열에서만 숫자 추출

여기에 도움을 줄 수있는 VBA 코드가 있습니다. 다음과 같이하십시오.

1. 누르고 Alt + F11 키를 눌러 응용 프로그램 용 Microsoft Visual Basic 창.

2. 딸깍 하는 소리 끼워 넣다 > 모듈을 클릭하고 다음 코드를 모듈 창문.

VBA 코드 : 텍스트 문자열에서만 숫자 추출 :

Sub ExtrNumbersFromRange()
    Dim xRg As Range
    Dim xDRg As Range
    Dim xRRg As Range
    Dim nCellLength As Integer
    Dim xNumber As Integer
    Dim strNumber As String
    Dim xTitleId As String
    Dim xI As Integer
    xTitleId = "KutoolsforExcel"
    Set xDRg = Application.InputBox("Please select text strings:", xTitleId, "", Type:=8)
    If TypeName(xDRg) = "Nothing" Then Exit Sub
    Set xRRg = Application.InputBox("Please select output cell:", xTitleId, "", Type:=8)
    If TypeName(xRRg) = "Nothing" Then Exit Sub
    xI = 0
    strNumber = ""
  For Each xRg In xDRg
    xI = xI + 1
    nCellLength = Len(xRg)
    For xNumber = 1 To nCellLength
      If IsNumeric(Mid(xRg, xNumber, 1)) Then
        strNumber = strNumber & Mid(xRg, xNumber, 1)
      End If
    Next xNumber
    xRRg.Item(xI) = strNumber
    strNumber = ""
  Next xRg
End Sub

3. 그런 다음 F5 키를 눌러이 코드를 실행하면 사용할 텍스트 범위를 선택하라는 메시지 상자가 나타납니다. 스크린 샷을 참조하십시오.

문서 추출 번호 만 3

4. 그런 다음 OK, 다른 프롬프트 상자는 다음과 같습니다. 결과를 출력 할 셀을 선택하십시오. 스크린 샷을 참조하십시오.

문서 추출 번호 만 4

5. 마지막으로 OK 버튼을 누르면 선택한 셀의 모든 숫자가 한 번에 추출됩니다.


방법 3 : Excel 용 Kutools를 사용하여 텍스트 문자열에서만 숫자 추출

Excel 용 Kutools 또한 호출되는 강력한 기능이 있습니다 발췌 번호,이 기능을 사용하면 원본 텍스트 문자열에서 숫자 만 빠르게 추출 할 수 있습니다.

Excel 용 Kutools : 300 개 이상의 편리한 Excel 추가 기능으로 30 일 동안 제한없이 무료로 사용해 볼 수 있습니다.

설치 후 Excel 용 Kutools, 다음과 같이하십시오.

1. 결과를 넣을 텍스트 문자열 옆의 셀을 클릭합니다 (스크린 샷 참조).

문서 추출 번호 만 5

2. 그런 다음 쿠툴 > Kutools 기능 > 본문 > 발췌 번호, 스크린 샷 참조 :

문서 추출 번호 만 6

3. 에서 함수 인수 대화 상자에서 숫자를 추출 할 셀을 선택하십시오. Txt 텍스트 상자를 입력 한 다음 참된 or 그릇된N 텍스트 상자, 스크린 샷 참조 :

문서 추출 번호 만 7

주의 사항: 논쟁 거리 N 다음을 입력하면 선택 항목입니다. 참된, 입력하면 숫자가 숫자로 반환됩니다. 그릇된, 텍스트 형식으로 숫자를 반환하고 기본값은 false이므로 비워 둘 수 있습니다.

4. 그런 다음 OK, 선택한 셀에서 숫자가 추출 된 다음 채우기 핸들을이 기능을 적용하려는 셀로 드래그하면 다음과 같은 결과가 나타납니다.

문서 추출 번호 만 8

Excel 용 Kutools를 지금 다운로드하고 무료로 평가하려면 클릭하십시오!


방법 4 : 수식을 사용하여 텍스트 문자열에서만 XNUMX 진수 추출

워크 시트에 소수를 포함하는 텍스트 문자열 인 경우 어떻게 텍스트 문자열에서 소수만 추출 할 수 있습니까?

아래 공식을 사용하면 텍스트 문자열에서 XNUMX 진수를 빠르고 쉽게 추출 할 수 있습니다.

이 공식을 입력하십시오 :=LOOKUP(9.9E+307,--LEFT(MID(A5,MIN(FIND({1,2,3,4,5,6,7,8,9,0}, $A5&"1023456789")),999),ROW(INDIRECT("1:999")))), 그런 다음이 수식을 포함 할 셀까지 핸들을 채 웁니다. 텍스트 문자열에서 모든 십진수가 추출되었습니다. 스크린 샷을 참조하십시오.

문서 추출 번호 만 13


Excel 용 Kutools를 사용하여 문자열에서만 숫자 추출

Excel 용 Kutools: 300 개 이상의 편리한 Excel 추가 기능으로 30 일 동안 제한없이 무료로 사용해 볼 수 있습니다. 지금 다운로드 및 무료 평가판!

관련 기사 :

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (61)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how to get a extract extact numbers from text
This comment was minimized by the moderator on the site
Hi, I'm looking to list all numbers in a string before a certain character. The string has letters and numbers, so I want to remove the letters and only list the numbers that appear before the second minus sign "-". Example:MUMUT-S941-22460991e002
I want that to isolate the numbers 941 in the above example.
This comment was minimized by the moderator on the site
How to use Index instead of Indirect to extract number from string. Indirect is volatile and Index can replace it as per http://www.excelhero.com/blog/2011/03/the-imposing-index.html. Thanks Ahead!
This comment was minimized by the moderator on the site
Hello! I found the following formula to extract only the numbers from text strings in Excel very useful

SUMPRODUCT(MID(0&A5, LARGE(INDEX(ISNUMBER(--MID(A5, ROW(INDIRECT("1:"&LEN(A5))), 1)) * ROW(INDIRECT("1:"&LEN(A5))), 0), ROW(INDIRECT("1:"&LEN(A5))))+1, 1) * 10^ROW(INDIRECT("1:"&LEN(A5)))/10)

Could you explain more on this formula as it seems quite complicated? Many thanks.
This comment was minimized by the moderator on the site
Reading ID: 3151346 BeatO User ID: 239930 Name: Mahesh Phone: 9823010759 Email: City: nashik State: Maharashtra Reading: 55 Meal Time: Random Meal Type: RANDOM Reading Time: 2020-03-01 00:15:57 View user readings in Portal



I want to extract numeric no. post Reading text
This comment was minimized by the moderator on the site
Hello, how can i extract the cheque no.only from the below text

OUTWARD CLEARING CLRG CHQ DEPOSIT CHQ. NO: 000123~700320456 ABCD ARAB PLAZ BRANC Value DATE, 01/02/2020 - S79519642

i tried below formula and its working but i need to change the 1:57 by calculating how many character before the first digit plus how many digits i want to extract.
=MIN(FIND({0,1,2,3,4,5,6,7,8,9},A3&"0123456789"))+5 im using this formula to know how many characters before the first number..

=TEXTJOIN("",TRUE,IFERROR(MID(A3,ROW(INDIRECT("1:57")),1)+0,""))
This comment was minimized by the moderator on the site
=Mid(A2,find("CHQ. NO", A2)+9,6)
This comment was minimized by the moderator on the site
Hi. I wonder to know is it possible to extract from the next string '102-105+106-10605-10605 -10631-10632-10633-10634-10635+107' all values of only three digits that have sign '-' (i.e. minus) before them (or plus - doesn't matter). Then extract extract all 5-digits values with the same rule? If this is possible to do I will save many many hours of manual work that I can devote to lot's of uselful tasks.

P.S.
I know that regular expressions are able to do that, BUT... I hate their syntax, so I'm searching any other method to complete this task.

Thanks in advance.
This comment was minimized by the moderator on the site
Hi, is it possible to extract the numbers before "g", for example : 25,20,15,25,300,40

Ali Baba Dark Chocolate 25g box 12 pcs
Ali Baba Dark Chocolate 20g*24 box
Cadbury 5 Star White Chocolate 15g
Kinder 2 White Chocolate 25g*24
ALpella Biscuits W/Marshmallow300g
Alpella Chocolate 40g
This comment was minimized by the moderator on the site
did anyone answer or did you figure this out? this is exactly my problem right - even down to the letter 'g'. the problem with the formula I am using now is that it returns the first number, if there are more than one, from the string and not the number I am wishing to return.
This comment was minimized by the moderator on the site
Hi, is it possible to extract the numbers before "g", for example : 25,20,15,25,300,40


Ali Baba Dark Chocolate 25g box 12 pcs
Ali Baba Dark Chocolate 20g*24 box
Cadbury 5 Star White Chocolate 15g
Kinder 2 White Chocolate 25g*24
ALpella Biscuits W/Marshmallow300g
Alpella Chocolate 40g
This comment was minimized by the moderator on the site
can any one answer this question, how to extract the no's
This comment was minimized by the moderator on the site
You may try select the number before g in the first cell, copy and paste it in new cell. Then press CTRL + E. All the number before g will be auto generated. 

This comment was minimized by the moderator on the site
Tkssssss you saved my day :) God bless you
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