Mid function

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,060
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
I have this data and trying to get the desired output, but no luck, is there a way to do it. I tried search, mid functions version is excel 2016.

from input to get the required outputs.


Book3
ABCDEF
1InputOutput 1Output 2Output 3Output 4Output 5
2707-00_BYSHJZ00OL0-GPON-1/1/1/6707-00_BYSHJZ00OL01116
3117-00_ESKNRD00OL3-GPON-1/1/13/1117-00_ESKNRD00OL311131
4707-00_BYSHJZ00OL0-GPON-1/1/1/7707-00_BYSHJZ00OL01117
5414-00_KYBRDN00OL1-GPON-1/1/16/1414-00_KYBRDN00OL111161
6241-00_RABGKH00OL1-GPON-1/1/16/2241-00_RABGKH00OL111162
7704-00_KARTJZAAOL0-GPON-1/1/3/4704-00_KARTJZAAOL01134
8704-00_KARTJZAAOL0-GPON-1/1/4/1704-00_KARTJZAAOL01141
9231-00_SHBRKH00OL1-GPON-1/1/1/7231-00_SHBRKH00OL11117
10701-00_KSHARR00OL7-GPON-1/1/8/8701-00_KSHARR00OL71188
11418-00_ESKNDN00OL5-GPON-1/1/11/10418-00_ESKNDN00OL5111110
12405-41_QDSYTBAAOL4-GPON-1/1/1/8405-41_QDSYTBAAOL41118
13213-00_MSLMKH00OL2-GPON-1/1/5/16213-00_MSLMKH00OL211516
14212-00_SHRFKH00OL8-GPON-1/1/6/5212-00_SHRFKH00OL81165
15428-00_DEFADN00OL2-GPON-1/1/3/3428-00_DEFADN00OL21133
16232-00_HWAYKH00OL2-GPON-1/1/7/1232-00_HWAYKH00OL21171
17KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/10KWRHTBBG_KWRHTBBGOL0111610
18KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/11KWRHTBBG_KWRHTBBGOL0111611
19KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/12KWRHTBBG_KWRHTBBGOL0111612
20KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/4KWRHTBBG_KWRHTBBGOL011164
21KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/5KWRHTBBG_KWRHTBBGOL011165
22KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/6KWRHTBBG_KWRHTBBGOL011166
Sheet1
 
=FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE($A2,"-","/"),"/","</m><m>")&"</m></k>","//m[.=number()][position()=last()]")
How about
Fluff.xlsm
ABCDEF
1InputOutput 1Output 2Output 3Output 4Output 5
2707-00_BYSHJZ00OL0-GPON-1/1/1/6707-00_BYSHJZ00OL01116
3117-00_ESKNRD00OL3-GPON-1/1/13/1117-00_ESKNRD00OL311131
4707-00_BYSHJZ00OL0-GPON-1/1/1/7707-00_BYSHJZ00OL01117
5414-00_KYBRDN00OL1-GPON-1/1/16/1414-00_KYBRDN00OL111161
6241-00_RABGKH00OL1-GPON-1/1/16/2241-00_RABGKH00OL111162
7704-00_KARTJZAAOL0-GPON-1/1/3/4704-00_KARTJZAAOL01134
8704-00_KARTJZAAOL0-GPON-1/1/4/1704-00_KARTJZAAOL01141
9231-00_SHBRKH00OL1-GPON-1/1/1/7231-00_SHBRKH00OL11117
10701-00_KSHARR00OL7-GPON-1/1/8/8701-00_KSHARR00OL71188
11418-00_ESKNDN00OL5-GPON-1/1/11/10418-00_ESKNDN00OL5111110
12405-41_QDSYTBAAOL4-GPON-1/1/1/8405-41_QDSYTBAAOL41118
13213-00_MSLMKH00OL2-GPON-1/1/5/16213-00_MSLMKH00OL211516
14212-00_SHRFKH00OL8-GPON-1/1/6/5212-00_SHRFKH00OL81165
15428-00_DEFADN00OL2-GPON-1/1/3/3428-00_DEFADN00OL21133
16232-00_HWAYKH00OL2-GPON-1/1/7/1232-00_HWAYKH00OL21171
17KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/10KWRHTBBG_KWRHTBBGOL0111610
18KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/11KWRHTBBG_KWRHTBBGOL0111611
19KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/12KWRHTBBG_KWRHTBBGOL0111612
20KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/4KWRHTBBG_KWRHTBBGOL011164
21KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/5KWRHTBBG_KWRHTBBGOL011165
22KWRHTBBG_KWRHTBBGOL0-XGS-PON-1/1/16/6KWRHTBBG_KWRHTBBGOL011166
Sheet5
Cell Formulas
RangeFormula
B2:B22B2=LEFT(A2,FIND("-",A2,FIND("_",A2))-1)
C2:C22C2=FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE($A2,"-","/"),"/","</m><m>")&"</m></k>","//m[.=number()][position()=last()-3]")
D2:D22D2=FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE($A2,"-","/"),"/","</m><m>")&"</m></k>","//m[.=number()][position()=last()-2]")
E2:E22E2=FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE($A2,"-","/"),"/","</m><m>")&"</m></k>","//m[.=number()][position()=last()-1]")
F2:F22F2=FILTERXML("<k><m>"&SUBSTITUTE(SUBSTITUTE($A2,"-","/"),"/","</m><m>")&"</m></k>","//m[.=number()][position()=last()]")
perfect thanks a ton, this is correct
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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