How do I change replace text in a cell for different text?

  • Thread starter Thread starter ronedwards
  • Start date Start date
R

ronedwards

have a couple of thousand lines of information that basically is this:

Xxxxxxx_Xxxxxxx Xxxxxxx Xxxxxx_YYY_Xxx.Zzz

Where X is a letter, Y a number, Zzz the file extension.

The information in the cell is not a formula.

I need to be able to

a/ change the file extension name (all going from one the same to a
different one the same)

b/ remove the YYY_Xxx before the file extension, but the other info
stays the same.

I'm sure there is a convaluted formula, or maybe an easy one?!?!

TIA!
 
Are all the file names the same length? If so, it could be a easy as:

=LEFT(A1,32) & ".ext"

where ext should be replace with the new extension.

If they are different lengths, then perhaps:

=LEFT(A1,LEN(A1)- 11) & ".ext"

HTH,
Bernie
MS Excel MVP
 
Are all the file names the same length? If so, it could be a easy as:

=LEFT(A1,32) & ".ext"

where ext should be replace with the new extension.

If they are different lengths, then perhaps:

=LEFT(A1,LEN(A1)- 11) & ".ext"

HTH,
Bernie
MS Excel MVP
 
-If they are different lengths, then perhaps:

=LEFT(A1,LEN(A1)- 11) & ".ext"-

Thanks - yes they are all different lengths, with "_YYY_Xxx.Zzz" bein
the only constant. When using your formula, it changes the .ext, bu
doesn't leave the filenames at the correct lengths....
 
-If they are different lengths, then perhaps:

=LEFT(A1,LEN(A1)- 11) & ".ext"-

Thanks - yes they are all different lengths, with "_YYY_Xxx.Zzz" bein
the only constant. When using your formula, it changes the .ext, bu
doesn't leave the filenames at the correct lengths....
 
SORRY - my bad - it does work, I was using the wrong column.....
THANKS!!
 
SORRY - my bad - it does work, I was using the wrong column.....
THANKS!!
 
If I have

Xxxxxxx_Xxxxxxx Xxxxxxx Xxxxxx_YYY_Xxx.Zzz

in cell A1, this formula in B1:

=LEFT(A1,LEN(A1)- 11) & ".QQQ"

returns

Xxxxxxx_Xxxxxxx Xxxxxxx Xxxxxx_.QQQ

Since it is now "_YYY_Xxx.Zzz" that is constant (and not "YYY_Xxx.Zzz" as
you first said) the formula

=LEFT(A1,LEN(A1)- 12) & ".QQQ"

will replace the "_YYY_Xxx.Zzz" with ".QQQ" and return

Xxxxxxx_Xxxxxxx Xxxxxxx Xxxxxx.QQQ

So I don't see what your problem with the formula is...

Bernie
 
If I have

Xxxxxxx_Xxxxxxx Xxxxxxx Xxxxxx_YYY_Xxx.Zzz

in cell A1, this formula in B1:

=LEFT(A1,LEN(A1)- 11) & ".QQQ"

returns

Xxxxxxx_Xxxxxxx Xxxxxxx Xxxxxx_.QQQ

Since it is now "_YYY_Xxx.Zzz" that is constant (and not "YYY_Xxx.Zzz" as
you first said) the formula

=LEFT(A1,LEN(A1)- 12) & ".QQQ"

will replace the "_YYY_Xxx.Zzz" with ".QQQ" and return

Xxxxxxx_Xxxxxxx Xxxxxxx Xxxxxx.QQQ

So I don't see what your problem with the formula is...

Bernie
 

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