# Microsoft Office Application Help - Excel Help forum > Excel General >  >  Get the characters before and after the "-" (dash)

## smalltime

Hello forumers,

I know about RIGHT,LEFT and MID functions of EXCEL
But this time, i want to get different characters.

I want to get the left and right characters after the dash.

Sample input   |    Expected output (left side)  |  expected output (right side)
ABCD-es1                ABCD                                      es1
EFG-xxx                  EFG                                         xxx
N1N-GET                 N1N                                          GET



All inputs have dash on it.
As much as possible, macro will not be use.

Thanks in Advance

----------


## teylyn

Hello smalltime,

to extract the text to the left of the dash

=LEFT(A1,FIND("-",A1)-1)

to extract the text to the right of the dash

=MID(A1,FIND("-",A1)+1,99)

cheers

----------


## zbor

select column -> Data -> Text to columns -> Delimited -> write - in box -> Finnish

----------


## smalltime

hi teylyn,

your suggestion works perfectly..
the solution i found involves using LEN,SEARCH, LEFT and RIGHT.
thanks


@zbor..your solution also works but i need to perform it automatically
thanks

----------


## teylyn

smalltime, thanks for your feedback.

If you are satisfied with the solution(s) provided, please mark your thread as Solved. 

*How to mark a thread Solved*
Go to the first post 
Click edit
Click Go Advanced
Just below the word *Title* you will see a dropdown with the word No prefix.
Change to Solved
Click Save

----------


## regikono

If the text from the right side has another hyphens, the action "select column -> Data -> Text to columns -> Delimited -> write - in box -> Finnish" will spread your text in columns. In my case, by following teylyn hint,  this has worked: =MID(A1;FIND("-";A1)+1,99; 1000). Note that I use semicolon instead of comma, change it if you need.

----------

