메인 컨텐츠로 가기

Excel의 텍스트 문자열에서 첫 번째 / 마지막 숫자의 위치를 ​​찾는 방법은 무엇입니까?

예를 들어 문자와 숫자가 혼합 된 텍스트 문자열 목록이 있습니다. 각 문자열에서 첫 번째 또는 마지막 숫자의 위치를 ​​찾으려면 어떻게해야합니까? 실제로 수식을 사용하면 지정된 텍스트 문자열에서 첫 번째 / 마지막 숫자의 위치를 ​​빠르게 찾을 수 있습니다. 이 자습서에서는이 문제를 처리하는 방법에 대해 자세히 설명합니다.

Excel의 텍스트 문자열에서 첫 번째 숫자의 위치 찾기
Excel의 텍스트 문자열에서 마지막 숫자의 위치 찾기


Excel의 텍스트 문자열에서 첫 번째 숫자의 위치 찾기

아래 스크린 샷과 같이 텍스트 문자열에서 첫 번째 숫자의 위치를 ​​찾으려면 다음과 같이하십시오.

1. B2 셀을 선택하고 아래 수식 중 하나를 복사하여 수식 입력 줄에 붙여 넣습니다.

1). 공식 1 : = MIN (SEARCH ({0,1,2,3,4,5,6,7,8,9}, A2 & "0123456789"));

2). 공식 2 : =MATCH(TRUE,ABS(CODE(MID(A2,ROW($A$1:INDEX(A:A,LEN(A2))),1))-52.5)<5,0) + Ctrl 키 + 변화 + 엔터 버튼;

3). 공식 3 : =MIN(IF(ISERROR(FIND({1;2;3;4;5;6;7;8;9;0},A2)),"",FIND({1;2;3;4;5;6;7;8;9;0},A2))).

2. 그런 다음 첫 번째 문자열의 첫 번째 숫자 위치가 B2 셀에 표시됩니다. 이제 채우기 핸들을 B7 셀로 끌어 아래 범위를 채 웁니다.

그런 다음 전체 문자열의 모든 첫 번째 숫자 위치가 나열됩니다.


Excel의 텍스트 문자열에서 마지막 숫자의 위치 찾기

첫 번째 숫자의 위치를 ​​찾은 후 이제 문자열에서 마지막 숫자의 위치를 ​​찾기 시작합니다.

이 섹션에는 두 가지 공식이 있습니다.

수식 1 : = MAX (IF (ISNUMBER (VALUE (MID (A2, ROW (INDIRECT ( "1 :"& LEN (A2))), 1))), ROW (INDIRECT ( "1 :"& LEN (A2)))) ) + Ctrl 키 + 변화 + 엔터 버튼;

수식 2 : =MAX(IFERROR(FIND({1,2,3,4,5,6,7,8,9,0},A2,ROW(INDIRECT("1:"&LEN(A2)))),0)) + Ctrl 키 + 변화 + 엔터 버튼

1. B2 셀을 선택하고 위의 수식 중 하나를 복사하여 수식 입력 줄에 붙여 넣은 다음 Ctrl + Shift + Enter 키를 동시에 누릅니다. 그러면 B2에 결과가 표시되는 것을 볼 수 있습니다.

2. B2를 선택하고 채우기 핸들을 B7 셀로 끌어 범위를 자동으로 채 웁니다.

그러면 전체 텍스트 문자열의 모든 마지막 숫자의 위치를 ​​즉시 얻을 수 있습니다.


Excel에서 한 셀의 텍스트와 숫자를 두 개의 열로 쉽게 분리합니다.

Excel 용 Kutools 셀 분할 유틸리티를 사용하면 특정 구분 기호로 셀 범위를 행 또는 열로 분할하고, 텍스트와 숫자를 분할하거나, certian 길이로 텍스트를 분할 할 수 있습니다. 지금 다운로드하여 사용해 보세요! (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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Ich habe gerade diese Lösung ausprobiert und es klappt bei mir nicht. Hat sich inzwischen etwas, was die Matrixformel betrifft, geändert?
This comment was minimized by the moderator on the site
Hi Wolfgang,

The formulas provided in this post work well in my case. What result did you get?
This comment was minimized by the moderator on the site
Thought I would let everyone know that I needed to find the last position of the house numbers in an address field in access. The only way I could do this was to export a short query to excel and run this formula. I know there is a way to get the excel functions in access but this was much easier. I had addresses that had varying house number lengths and then you throw in the 1st, 2nd, 3rd...St., Ave into the mix within the street name and you got a major problem parsing a very bad formatted address string.

address examples 1234 nw (or NW) 4th St.
12 West St North (or N)
123,456, and 789 Heritage Circle (or Crc)
123 & 456 N 1st. St

I figured out a way to parse off the first and second example real quick with some research (I would give credit, but right now I can't remember where I got the answer). It involved creating a VBA function to accomplish it. That worked great but I came to a problem when we come to the first "," or "and" or "&".

Using this formula in excel found the last number I needed without choosing the street number. Since most house numbers ended with a space " " between them and the direction segment or the street name segment, I added --- &" " after the find formula. Like this: in an array formula
=MAX(IFERROR(FIND({1,2,3,4,5,6,7,8,9,0}&" ",E2,ROW(INDIRECT("1:"&LEN(E2)))),0))
A quick export back to an access table and wala! you have the number.
202 & 206 N Blanche Ave = 9

Now I know I could probably parse the rest of the address in excel but it actually worked real well in Access, so I just decided to do the rest there.

If there is a way to do it all in Access, I couldn't find it or figure it out.
This comment was minimized by the moderator on the site
goood, thanks
This comment was minimized by the moderator on the site
That's what I needed =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789"));

thank you very much!
This comment was minimized by the moderator on the site
You are welcome O(∩_∩)O
This comment was minimized by the moderator on the site
how to get this to work in powerpivot
This comment was minimized by the moderator on the site
Hi,
Sorry can't help with this.
This comment was minimized by the moderator on the site
.... and here I thought that I knew Excel well. Bravo!!!!!
This comment was minimized by the moderator on the site
And here is a formula for finding the position of the last numeric character in a string, but WITHOUT using an array formula: =MAX(SEARCH(CHAR(9),SUBSTITUTE("0123456789"&A1,{0,1,2,3,4,5,6,7,8,9},CHAR(9),LEN(A1)+10-LEN(SUBSTITUTE("0123456789"&A1,{0,1,2,3,4,5,6,7,8,9},"")))))-10 The number 10 appearing in this formula, are due to the length of the constant string "0123456789", that is concatenated in this formula.
This comment was minimized by the moderator on the site
Many Thanks , Great
This comment was minimized by the moderator on the site
Hi George, your formula is may meet my requirement. I need similar formula to find out digit position in the string listed in "A" row in B row Required output 8 5 1 4 3 1 3 2 5 5 6 6 1 7 9 9 1 1 6 0 9 3 0 2 7 4 9 3 6 5 5 7 4 9 8 10 2 10 0 8 1 9
This comment was minimized by the moderator on the site
This was exactly what I wanted. Thank you.
This comment was minimized by the moderator on the site
The function 1). Formula 1: =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")); It's absolutely what i needed and extremely cool! Thanks so much! Jon
This comment was minimized by the moderator on the site
Hats off mate..
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations