Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • How to get last column number in range in Excel
  • How to get first row number in range in Excel
  • Extract all partial matches in Excel
  • How to get address of named range in Excel
  • Lookup entire row in Excel

Data Analysis Examples

  • How to calculate average last N values in a table in Excel
  • How To Remove Duplicates In Excel Column Or Row?
  • Conditional Formatting Data bars Examples in Excel
  • Remove Duplicates Example in Excel
  • How to create a Histogram in Excel

Data Validation Examples

  • Excel Data validation unique values only
  • Excel Data validation must not contain
  • Excel Data validation allow weekday only
  • Excel Data validation exists in list
  • Excel Data validation must begin with

Remove text by position in a cell in Excel

by

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

Formula

=REPLACE(text,start,characters,"")

Explanation

In the example shown, the formula in C6 is:

=REPLACE(B6,1,24,"")

How this formula works

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

Worked Example:   Remove first character in a cell in Excel

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.

Worked Example:   Remove text by variable position in a cell in Excel

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 (“”).

Worked Example:   SUBSTITUTE function vs REPLACE function in Excel

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:

=SUBSTITUTE(text,path_to_remove,"")

Post navigation

Previous Post:

Remove text by matching in a cell in Excel

Next Post:

Remove file extension from filename in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • Manipulating text strings using Left, Mid, Right, Len, Substitute in Excel
  • Remove line breaks in a cell in Excel
  • How to Separate Text Strings in Excel
  • Normalize text by removing punctuations, extra spaces and more in Excel
  • How to strip html from text or numbers in Excel
  • Get work hours between dates and times in Excel
  • Calculate number of hours between two times in Excel
  • Convert text timestamp into time in Excel
  • How to calculate project start date based on end date in Excel
  • How to calculate future date say 6 months ahead in Excel
  • COUPDAYS function: Description, Usage, Syntax, Examples and Explanation
  • COUPDAYBS function: Description, Usage, Syntax, Examples and Explanation
  • COUPDAYSNC function: Description, Usage, Syntax, Examples and Explanation
  • XNPV function: Description, Usage, Syntax, Examples and Explanation
  • AMORDEGRC function: Description, Usage, Syntax, Examples and Explanation
© 2022 xlsoffice . All Right Reserved. | Teal Smiles