How to split a cell into 3 columns

G

grim72

I have a table of data with product codes
I want to split the code into 3 sections as below:
Full code: 17896Z

Split into:
1
7896
Z

I know how to get the 1 and the Z using =LEFT(A1,1) or =RIGHT(A1,1)
but wasn't sure how to get the middle section?
 
N

nr

I have a table of data with product codes
I want to split the code into 3 sections as below:
Full code: 17896Z

Split into:
1
7896
Z

I know how to get the 1 and the Z using =LEFT(A1,1) or =RIGHT(A1,1)
but wasn't sure how to get the middle section?

If your sizes of the codes are consistent, use MID(A1,2,4).
 
M

Ms-Exl-Learner

Hi Grim72,

The below formula will work on any number of characters and bring the
first letter, last letter and the remaining letters by ignoring the
first and last letters.

Text Results:-
=LEFT(TRIM(A1),1)
=MID(A1,2,LEN(TRIM(A1))-2)
=RIGHT(TRIM(A1),1)

Real Numbers:-
=VALUE(LEFT(TRIM(A1),1))
=VALUE(MID(A1,2,LEN(TRIM(A1))-2))

Real Numbers values are always stay in right side and text number
values will stay in left side. Use Value function in front of the
formula to convert the text value to real value.

Hope it's clear to you!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top