Separation Formula Required

ShoaibAli

Banned - Rules violations
Joined
Jan 15, 2020
Messages
121
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
I want to separate name and id from ColA to ColB as name and ColC as ID's please share formula.


Name / Primary - ID / Secondary - IDName Primary - ID / Secondary - ID
Kashif Khan - 526584944Kashif Khan526584944
Shoaib Ali - 25624621 / Jahanzain Rajput - 265565414Shoaib Ali / Jahanzain Rajput 25624621 / 265565414
PVT - 111111111 / Kashif Khan - 526584944PVT / Kashif Khan111111111 / 526584944
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi,

you can do it with flash fill tool. is that necessary to use formula? :unsure:
 
Upvote 0
Yes it is necessary to do with formula it can be done With Left, right and mid formula

Also posted here
 
Last edited by a moderator:
Upvote 0
OK, well you can do it with below formulas:

for name column:
Code:
=LEFT(A2,FIND("-",A2)-1)&IFERROR(MID(A2,FIND("/",A2),FIND("-",A2,FIND("/",A2))-FIND("/",A2)),"")

and for ID you can use this formula:
Code:
=IFERROR(MID(A2,FIND("-",A2)+1,FIND("/",A2)-FIND("-",A2)),RIGHT(A2,LEN(A2)-FIND("-",A2)))&IFERROR(RIGHT(A2,LEN(A2)-FIND("-",A2,FIND("/",A2))),"")
 
Upvote 0
Shoaib: amiroo's formulas assume there are always at most 2 sets of name/number combinations. Is that the case always?
 
Upvote 0
While it's a 2-step process, I found in ASAP Utilities (FREE) options to remove all numbers from a column and remove all text from a column.
After running those two options on copies of the initial data, I did a substitute of "-" for the names and a trim after a substitute of "-" on the IDs.
Works VERY nicely if you can get by with the add'l steps. And, it doesn't matter how many sets of name/IDs you have.
 
Upvote 0
Perhaps this? (also handles several names/IDs)

ShoaibAli 2020-02-29 1.xlsm
ABC
1Name / Primary - ID / Secondary - IDName Primary - ID / Secondary - ID
2Kashif Khan - 526584944Kashif Khan526584944
3Shoaib Ali - 25624621 / Jahanzain Rajput - 265565414Shoaib Ali / Jahanzain Rajput25624621 / 265565414
4PVT - 111111111 / Kashif Khan - 526584944PVT / Kashif Khan111111111 / 526584944
5Name 1 - 12365 / Name 2 - 89652145 / Name 3 - 562524 / Name 4 - 986524Name 1 / Name 2 / Name 3 / Name 412365 / 89652145 / 562524 / 986524
Sheet1
Cell Formulas
RangeFormula
B2:B5B2=TEXTJOIN(" / ",1,TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"-","/"),"/",REPT(" ",100)),SEQUENCE(,LEN(A2),,200),100)))
C2:C5C2=TEXTJOIN(" / ",1,TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"-","/"),"/",REPT(" ",100)),SEQUENCE(,LEN(A2),100,200),100)))
 
Upvote 0
Peter: that's a really slick use of the new SEQUENCE dynamic arrays function!
 
Upvote 0
Peter_SSs

It not working look.

Name / Primary - ID / Secondary - IDNamePrimary - ID / Secondary - ID
Kashif Khan - 526584944#NAME?
#NAME?​
Shoaib Ali - 25624621 / Jahanzain Rajput - 265565414#NAME?#NAME?
PVT - 111111111 / Kashif Khan - 526584944#NAME?#NAME?
Name 1 - 12365 / Name 2 - 89652145 / Name 3 - 562524 / Name 4 - 986524#NAME?#NAME?
 
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,616
Members
449,238
Latest member
wcbyers

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