take some data column into next column ie ABC-DEF-GHI i want DEF

B

Bernard

i want to copy the mid section of the data in a column into the next column.
each row has a cell with this "ABC-DEF-GHI" configuration of date. i only
want "DEF" (the middle section)
 
L

Luke M

One of these should work:

If always that exact structure:
=MID(A2,5,3)

If structure varies, but middle is always 3 characters:
=MID(A2,FIND("-",A2)+1),3)

If structure varies and middle is not always 3 characters:
=MID(A2,FIND("-",A2)+1,FIND("-",MID(A2,FIND("-",A2)+1,999))-1)
 
P

Per Jessen

Hi

TextToColumns function on the data menu is what you need.

Use the wizard, dash as delimiter skip first and last column, and set
destination to next column.

Hopes this helps.
....
Per
 
D

Don Guillett

For a formula solution, use FIND within a MID formula. Or use a macro with
INSTR and INSTRREV
 
J

Jacob Skaria

Try
=MID(TRIM(LEFT(SUBSTITUTE(A1,"-",REPT(" ",255),2),255)),FIND("-",A1)+1,255)

If this post helps click Yes
 
G

Gord Dibben

Per

You think like I do.

Why use formulas when you don't have to.


Gord Dibben MS Excel MVP
 

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