In the current version of Excel, the TEXTAFTER function is a simple way to solve this problem.

Both approaches are explained below.

TEXTAFTER function

TheTEXTAFTER functionreturns the text that occursaftera given delimiter.

Excel formula: Get domain from email address

and returns “com”, which is the top-level domain.

As the formula is copied down, the other top-level domains are returned.

For more on TEXTAFTER, seeHow to use the TEXTAFTER function.

Excel formula: Get middle name from full name

Legacy Excel

Older versions of Excel do not provide the TEXTAFTER function.

However, it operates in a series of small steps.

At the core, the formula uses theRIGHT functionto extract characters starting from the right.

Excel formula: Create email address from name

Once the position is known, the RIGHT function is used to extract the TLD.

How does the formula know to replace only the last dot?

This is the clever and complicated part.

Excel formula: Get domain name from URL

If no value is supplied forinstance_num, SUBSTITUTE will replaceall instancesofold_textwithnew_text.

However, if aninstance_numis provided, SUBSTITUTE will only replace that particular instance of old_text (i.e.

if 2 is provided, SUBSTITUTE will replace the second instance).

Excel formula: Get name from email address

For example, the value in cell B5 is “https://www.domain.com”.

For example, =RIGHT(“apple”,3) returns “ple”.

LEN will also count characters in numbers, but number formatting is not included.

Excel formula: Remove protocol from URL

SUBSTITUTE Function

The Excel SUBSTITUTE function replaces text in a given string by matching.

When the text is not found, FIND returns a #VALUE error.

Excel TEXTAFTER function

Excel RIGHT function

Excel LEN function

Excel SUBSTITUTE function

Excel FIND function