extracting 6 digit number from text field

Tipsey

New Member
Joined
Oct 28, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I have a list of employee names followed by their employee number, followed by their starting shift times.
eg.

Bob Ross 123456 530 530 730 730 530
Bruce (batman) Wayne 223344 1130 1130 1130 1130 1200

etc.

I would like to extract only their employee number.

Thanks in advance.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Please try this:
=FILTER(TEXTSPLIT(L4," ",,TRUE),LEN(TEXTSPLIT(L4," ",,TRUE))=6,"")
Where L4 is the cell to evaluate
 
Upvote 0
Or even a shorter version:
=LET(TS,TEXTSPLIT(L4," ",,TRUE),FILTER(TS,LEN(TS)=6,""))
 
Upvote 0
Another option
Fluff.xlsm
AB
1
2Bob Ross 123456 530 530 730 730 530123456
3Bruce (batman) Wayne 223344 1130 1130 1130 1130 1200223344
Main
Cell Formulas
RangeFormula
B2:B3B2=FILTERXML("<k><m>"&SUBSTITUTE(A2," ","</m><m>")&"</m></k>","//m[.=number() and string-length()=6]")
 
Upvote 0
Solution

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top