3aIT Blog

An Excel-specific HowTo for you this month (although this method may well work in other apps). This time, we will explain how you can leverage the power of a wildcard to make what would otherwise be hours of work take a matter of seconds!

excelReplace1
Step 1: In this scenario, let's imagine we've done an export from a website and we've ended up with a load of text with HTML tags around it. Necessary for the website, but we don't need it for our purposes. Obviously, you could manually delete them all, but that could take ages if there's many rows. We can get rid of it all in one shot.


excelReplace2
Step 2: Go to the find and replace menu (Find & Select -> Replace). As HTML tags all follow a pattern of <some text>, we can match that with a <*> wildcard. This means "Match anything that starts with a < and ends with a >. In this case, what we want to do is replace that with nothing, which will remove those tags from the text. Hit Replace All.


excelReplace3
Step 3: The tags are all gone, leaving clean text! Note that it's always worth running through a few "Find Next" examples above when constructing these wildcard searches to make sure you haven't accidentally caught data you don't want to be changed in your net!


excelReplace4

Step 4: As a bonus stage, let's imagine that we wanted to standardise the text in this column. What we're left with in step 3 is fields that now all say Some ... text, with just that middle section changing. We can match this with a wildcard as above too. On hitting Replace All, all three fields are matched by our rule and get replaced.