how to include dash within a cell

  • Thread starter Thread starter Accounts jobs
  • Start date Start date
A

Accounts jobs

If anyone can help me in this I would be very greatful

We receive a list of codes like "TND4567". We manually put the dash
between the text and numbers. is there any way of doing it through a
formula in excel.
 
If your text is always 3 characters, then one way:

=LEFT(A1,3) & "-" & MID(A1,4,255)

where 255 is just a big number to ensure all the digits are captured.
 
If your text always begin with TND then try this:

Select your data range then go to...
Edit > Replace > Find what: TND > Replace with: TND- > Replace All
 
If you ALWAYS need the dash inserted between
the 3rd and 4th characters ....

try something like this:

=REPLACE(A1,1,3,LEFT(A1,3)&"-")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
True, but I hesitate to add the overhead of another function where it's
not needed. The recalc would be much faster using

MID(A1,4,32763)
 
You make a good point. =)

True, but I hesitate to add the overhead of another function where it's
not needed. The recalc would be much faster using

MID(A1,4,32763)
 

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

Back
Top