To extract the page, or the part of a path after the last forward slash (/), you can use a formula based on several Excel functions: TRIM, RIGHT, SUBSTITUTE, and REPT. In the example shown, the formula in C5 is:

=TRIM(RIGHT(SUBSTITUTE(B5,"/",REPT(" ",100)),100))

Generic formula

=TRIM(RIGHT(SUBSTITUTE(url,"/",REPT(" ",100)),100))


At the core, this formula replaces all forward slashes (/) with 100 spaces, then extracts 100 characters from the RIGHT and cleans this up with the TRIM function.

The replacement is done with SUBSTITUTE and REPT here:

SUBSTITUTE(B5,"/",REPT(" ",100))

Then, the RIGHT function extracts the last 100 characters of the string returned by SUBSTITUTE.

Finally, TRIM removes all leading and trailing space characters and returns the result.

Note: the use of 100 in this formula is arbitrary, and represents the maximum number of characters to be found after the final forward slash (/) in the original text. Adjust to suit your use case.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.