Quick, clean, and to the point

Remove text by position

Excel formula: Remove text by position
Generic formula 

To remove text from a cell by position, you can use the REPLACE function.

In the example shown, the formula in C6 is:


How this formula works

The replace function lets you replace text based on its location and length.

In this case, we want to strip off the drive and path, and leave only the document name.

The length of this part of the string (text) is 24 and the starting position is 1, and the pattern never changes.

The REPLACE function can handle this easily, we just need to provide a cell reference (B6), a starting position (1), the number of characters to replace (24), and the text to use for replacement ("").

For replacement, we use an empty string ("") which causes REPLACE to replace characters 1-24 with nothing.

Alternative with SUBSTITUTE

Since the text in this case never varies, you could also use the the SUBSTITUTE function:

Dave Bruns

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

Excel foundational video course
Excel Pivot Table video training course
Excel formulas and functions video training course
Excel Shortcuts Video Course
Excel Charts video training course
Video training for Excel Tables