Simple String question

ncoatney

New Member
Joined
Jan 4, 2018
Messages
6
I'm currently using a barcode scanner to input values into an excel sheet. the barcode contains values such as:

C000111254|HPSSF2517|14NIZE
C000098567|HSCF21|22BRSS

etc.

The beginning and end string length will always be the same. 10 characters and 6. the middle set will vary in length.

I need to extract and place as follows:
A1 B1 C1
C00011254 HPSSF2517 14NIZE
C00009856 HSCF21 22BRSS
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
If they are always separated by | then you could simply use Text to Columns with | as the separator.
 
Upvote 0
You can use Text to columns for that, select delimited & then use Other with |
 
Upvote 0
supposing your data in the cell A1

Try those fomulas in b1,c1,and d1 respectively
Code:
=LEFT(A1,FIND("|",A1)-1)
=MID(A1,(FIND("|",(SUBSTITUTE(A1,"|","*",2)))+1),(FIND("*",(SUBSTITUTE(A1,"|","*",2)))+1)-(FIND("|",(SUBSTITUTE(A1,"|","*",2)))+1)-1)
=MID(A1,(FIND("*",(SUBSTITUTE(A1,"|","*",2)))+1),LEN(A1))
[TABLE="width: 697"]
<tbody>[TR]
[TD]C000111254|HPSSF2517|14NIZE[/TD]
[TD]C000111254[/TD]
[TD]HPSSF2517[/TD]
[TD]14NIZE[/TD]
[/TR]
[TR]
[TD]C000098567|HSCF21|22BRSS[/TD]
[TD]C000098567[/TD]
[TD]HSCF21[/TD]
[TD]22BRSS[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Or with just one formula

Book1
ABCD
2C000111254|HPSSF2517|14NIZEC000111254HPSSF251714NIZE
3C000098567|HSCF21|22BRSSC000098567HSCF2122BRSS
Totals
Cell Formulas
RangeFormula
B2=TRIM(MID(SUBSTITUTE($A2,"|",REPT(" ",100)),(COLUMN(A1)-1)*100+1,100))


Drag down & accross
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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