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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
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))
C000111254|HPSSF2517|14NIZEC000111254HPSSF251714NIZE
C000098567|HSCF21|22BRSSC000098567HSCF2122BRSS

<tbody>
</tbody>
 
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,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

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