How do I create a formula to remove dashes?

J

jackierae17

I'm new to Excel. I have a huge inventory spreadsheet where I need to change
a column to reflect the following.

"P01-02-C-1" should become "P102C1" (remove 0 and dashes)

"V1-25-F-2E" should become "125F2E" (remove V and dashes)

HELP!!
 
J

Jacob Skaria

Try

=SUBSTITUTE(SUBSTITUTE(A1,"-",),"0",)

Removing 0 and dashes will make that "P12C1" and not "P102C1"

=SUBSTITUTE(SUBSTITUTE(A1,"V",),"-",)
 
P

Pete_UK

Just use Find & Replace (CTRL-H). Highlight the column by clicking on
the column header, then CTRL-H, and:

Find what: -
Replace with: (leave blank)
Click Replace All

Hope this helps.

Pete
 
R

Roxana

I have the perfect solution for you and it involves two easy steps:
(1) You will use the TEXT TO COLUMNS function to separate each set as : V1
in one column, 25 in another column, F in another column, 2E in another
column, etc. (Data: Text to Columns> click on "Delimited">select a delimiter:
"Other" and type a dash in it (-); click NEXT; click FINISH (this will
separate or parse your data).
(2) Now you want all of these pieces in one column, so use this function:
ampersand.
What you do is, go to the cell where you want your set of data, type "=",
click on the cell where you have the "V1" and type "&" in the formula, now
click on the cell where you have "25 and type "&", and so on forth until you
get your final product: "V125F2E".
Roxana
 
E

Eduardo

Hi,.
you can use find and replace, highlight the column , press CTRL + H, find
what enter -, replace with don't enter anything and click replace all, do the
same with the 0 and V
 
M

Ms-Exl-Learner

Assume that you are having the data in A1 cell.

Copy the below formula and paste in B1 cell.

=IF(A1="","",IF(VALUE(MID(TRIM(A1),2,1))=0,LEFT(TRIM(A1),1)&SUBSTITUTE(SUBSTITUTE(MID(TRIM(A1),3,255),"V",""),"-",""),SUBSTITUTE(SUBSTITUTE(TRIM(A1),"V",""),"-","")))

Remember to Click Yes, if this post helps!
 

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