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

  • Thread starter Thread starter Bernard
  • Start date Start date
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)
 
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)
 
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
 
For a formula solution, use FIND within a MID formula. Or use a macro with
INSTR and INSTRREV
 
Try
=MID(TRIM(LEFT(SUBSTITUTE(A1,"-",REPT(" ",255),2),255)),FIND("-",A1)+1,255)

If this post helps click Yes
 
Per

You think like I do.

Why use formulas when you don't have to.


Gord Dibben MS Excel MVP
 
Back
Top