Deleting/Replacing Part of a String With 3 Static Characters and 4 Variable Characters

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
701
Office Version
  1. 365
Platform
  1. Windows
I have thousands of records that have User IDs in them. I need to find a way to delete these User IDs, as the data is being sent externally. The issues that I'm encountering are:
- The text is not static. It always starts with UID, but the last 4 characters can be alpha-numeric variables.
- The text can be found in any position of a cell.
- I will only have a 4 hour window to pull data from various locations, consolidate and format it.

I've looked through this site, and a couple of other places, but have been unable to find a solution. This looked promising from Google, but I can't seem to get it to fit my needs:
Code:
=REPLACE(M14,SEARCH("UID",M14)+7,0,"")

Any assistance is appreciated!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi,

Here is an option you can try:


Excel 2013/2016
AB
1text UIDA123 ddfastext ddfas
2bla bla bla UID1234 text textbla bla bla text text
Sheet1
Cell Formulas
RangeFormula
B1=TRIM(REPLACE(A1,SEARCH("UID",A1),7,""))


If this doesn't help, representative examples of your text values and corresponding expected results would be very helpful.
 
Upvote 0
Other option:

=SUBSTITUTE(A1,MID(A1,SEARCH("UID",A1),8),"")
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top