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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Peter's formula requires Office 365 on a Monthly update channel. Since your profile says you have every current Windows version of Excel, it was a reasonable suggestion. ;)
 
Upvote 0
Edit: Ah, I see both of my comments have already been addressed. :)

It not working look.
It was written for Excel 365 which your profile says you have.

If this must work in other versions, how many name/id combinations could there be in a cell? If only 2, another suggestion has already been made for that. have you tried that?
 
Upvote 0
RoryA


Please help if i separate the all required field as below then which formulas will be used i have tried but could not succeeed.

1583154298168.png
 

Attachments

  • 1583154250469.png
    1583154250469.png
    9 KB · Views: 2
Upvote 0
if i separate the all required field as below then which formulas will be used
Try these

ShoaibAli 2020-02-29 1.xlsm
ABCDE
1Name / Primary - ID / Secondary - IDName IDName ID
2Kashif Khan - 526584944Kashif Khan526584944  
3Shoaib Ali - 25624621 / Jahanzain Rajput - 265565414Shoaib Ali25624621Jahanzain Rajput265565414
4PVT - 111111111 / Kashif Khan - 526584944PVT111111111Kashif Khan526584944
Sheet1 (2)
Cell Formulas
RangeFormula
B2:B4B2=TRIM(LEFT(A2,FIND("-",A2)-1))
C2:C4C2=TRIM(SUBSTITUTE(LEFT(A2,FIND("/",A2&"/")-1),B2&" -",""))
D2:D4D2=IF(FIND("/",A2&"/")<LEN(A2),TRIM(REPLACE(LEFT(A2,FIND("-",A2,FIND("/",A2))-1),1,FIND("/",A2),"")),"")
E2:E4E2=IF(D2="","",TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",20)),20)))
 
Upvote 0
Peter_SSs

Please look at the errors which are highlighted

1583419689438.png



Primary - ID / Secondary - ID
UNITED HEALTHCARE - 922837002UNITED HEALTHCARE922837002
HEALTH FIRST - 133615803 / MEDICARE- NATL - 112382762aHEALTH FIRST133615803MEDICARE112382762a
HEALTHFIRST MEDICAID - QE97026XHEALTHFIRST MEDICAIDQE97026X
MEDICARE- NATL - 122408242AMEDICAREMEDICARE- NATL - 122408242A
ELDERPLAN - 01319115801 / MEDICARE- NATL - 114660345AELDERPLAN01319115801MEDICARE114660345A
METROPLUS ESSENTIAL PLAN - 630382391METROPLUS ESSENTIAL PLAN630382391
MEDICARE- NATL - 9KM8AW3NK46 / MEDICAID - PK22234BMEDICAREMEDICARE- NATL - 9KM8AW3NK46MEDICAIDPK22234B
MEDICAID - YW71071DMEDICAIDYW71071D
FIDELES MEDICAID - 74280680900FIDELES MEDICAID74280680900
AETNA - MEBP07GF / MEDICARE- NATL - 110741820AAETNAMEBP07GFMEDICARE110741820A
PVT - 111111111PVT111111111
TRICARE - 00081456800 / 1199 SEIU - 9800569926TRICARE000814568001199 SEIU9800569926
MEDICARE- NATL - 058467921AMEDICAREMEDICARE- NATL - 058467921A
EMBLEM HEALTH - 932539946EMBLEM HEALTH932539946
HEALTHFIRST MEDICAID - PW15673PHEALTHFIRST MEDICAIDPW15673P
FIDELES MEDICAID - 74482085900 / MEDICAID - UW78283NFIDELES MEDICAID74482085900MEDICAIDUW78283N
HEALTHFIRST MEDICAID - KZ36913K / MEDICAID - KZ36913KHEALTHFIRST MEDICAIDKZ36913KMEDICAIDKZ36913K
EMPIRE BCBS - DPE84885086EMPIRE BCBSDPE84885086
HEALTH FIRST - KX64024BHEALTH FIRSTKX64024B
AFFINITY ESSENTIAL - 15050075500AFFINITY ESSENTIAL15050075500
HEALTHFIRST MEDICAID - XN22361JHEALTHFIRST MEDICAIDXN22361J
HEALTHFIRST ESSENTIAL PLAN - 420000023075600 / MEDICAID - KR13482DHEALTHFIRST ESSENTIAL PLAN420000023075600MEDICAIDKR13482D
EMBLEM HEALTH - 19114779EMBLEM HEALTH19114779
ELDERPLAN - 01374807101 / MEDICARE- NATL - 129742347AELDERPLAN01374807101MEDICARE129742347A
UNITED COMMUNITY PLAN - 116594426UNITED COMMUNITY PLAN116594426
 
Upvote 0
Please look at the errors which are highlighted
Oops, I missed seeing the Names that included the "-" character in your previous sample. :oops:

See if this is better.

ShoaibAli 2020-02-29 1.xlsm
ABCDE
1Name / Primary - ID / Secondary - IDName IDName ID
2UNITED HEALTHCARE - 922837002UNITED HEALTHCARE922837002  
3HEALTH FIRST - 133615803 / MEDICARE- NATL - 112382762aHEALTH FIRST133615803MEDICARE- NATL112382762a
4HEALTHFIRST MEDICAID - QE97026XHEALTHFIRST MEDICAIDQE97026X  
5MEDICARE- NATL - 122408242AMEDICARE- NATL122408242A  
6ELDERPLAN - 01319115801 / MEDICARE- NATL - 114660345AELDERPLAN01319115801MEDICARE- NATL114660345A
7METROPLUS ESSENTIAL PLAN - 630382391METROPLUS ESSENTIAL PLAN630382391  
8MEDICARE- NATL - 9KM8AW3NK46 / MEDICAID - PK22234BMEDICARE- NATL9KM8AW3NK46MEDICAIDPK22234B
9MEDICAID - YW71071DMEDICAIDYW71071D  
10FIDELES MEDICAID - 74280680900FIDELES MEDICAID74280680900  
11AETNA - MEBP07GF / MEDICARE- NATL - 110741820AAETNAMEBP07GFMEDICARE- NATL110741820A
12PVT - 111111111PVT111111111  
13TRICARE - 00081456800 / 1199 SEIU - 9800569926TRICARE000814568001199 SEIU9800569926
14MEDICARE- NATL - 058467921AMEDICARE- NATL058467921A  
15EMBLEM HEALTH - 932539946EMBLEM HEALTH932539946  
16HEALTHFIRST MEDICAID - PW15673PHEALTHFIRST MEDICAIDPW15673P  
17FIDELES MEDICAID - 74482085900 / MEDICAID - UW78283NFIDELES MEDICAID74482085900MEDICAIDUW78283N
18HEALTHFIRST MEDICAID - KZ36913K / MEDICAID - KZ36913KHEALTHFIRST MEDICAIDKZ36913KMEDICAIDKZ36913K
19EMPIRE BCBS - DPE84885086EMPIRE BCBSDPE84885086  
20HEALTH FIRST - KX64024BHEALTH FIRSTKX64024B  
21AFFINITY ESSENTIAL - 15050075500AFFINITY ESSENTIAL15050075500  
22HEALTHFIRST MEDICAID - XN22361JHEALTHFIRST MEDICAIDXN22361J  
23HEALTHFIRST ESSENTIAL PLAN - 420000023075600 / MEDICAID - KR13482DHEALTHFIRST ESSENTIAL PLAN420000023075600MEDICAIDKR13482D
24EMBLEM HEALTH - 19114779EMBLEM HEALTH19114779  
25ELDERPLAN - 01374807101 / MEDICARE- NATL - 129742347AELDERPLAN01374807101MEDICARE- NATL129742347A
26UNITED COMMUNITY PLAN - 116594426UNITED COMMUNITY PLAN116594426  
Sheet1 (4)
Cell Formulas
RangeFormula
B2:B26B2=TRIM(LEFT(A2,FIND(C2,A2)-3))
C2:C26C2=TRIM(RIGHT(SUBSTITUTE(TRIM(LEFT(A2,FIND("/",A2&"/")-1))," ",REPT(" ",30)),30))
D2:D26D2=IF(E2="","",TRIM(REPLACE(LEFT(A2,LEN(A2)-LEN(E2)-3),1,FIND("/",A2),"")))
E2:E26E2=IF(FIND("/",A2&"/")<LEN(A2),TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",30)),30)),"")
 
Upvote 0
Thank you for your consistent help.
 
Upvote 0

Forum statistics

Threads
1,216,114
Messages
6,128,913
Members
449,478
Latest member
Davenil

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