Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How To Create Frequency Distribution in Excel
  • How to calculate current stock or inventory in Excel
  • How to create Checklist in Excel
  • How to create a Histogram in Excel
  • Get column index in Excel Table

References

  • How to use Excel LOOKUP Function
  • Offset in Excel
  • Count rows with at least n matching values
  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • How to get address of named range in Excel

Data Validations

  • Excel Data validation no punctuation
  • Excel Data validation with conditional list
  • Excel Data validation allow weekday only
  • Excel Data validation whole percentage only
  • Excel Data validation specific characters only

Remove text by variable position in a cell in Excel

by

To remove text from a cell when the text is at a variable position, you can use a formula based on the REPLACE function, with help from the FIND function.

Formula

=REPLACE(text,start,FIND(marker,text)+1,"")

Explanation

In the example shown, the formula in C6 is:

=REPLACE(B6,1,FIND(":",B6)+1,"")

How this formula works

The REPLACE function will replace text by position. You can use REPLACE to remove text by providing an empty string (“”) for the “new_text” argument.

Worked Example:   Highlight cells that contain one of many in Excel

In this case, we want to remove the labels that appear inside text. The labels vary in length, and include words like “Make”, “Model”, “Fuel economy”, and so on. Each label is followed by a colon and a space. We can use the colon as a “marker” to figure out where the label ends.

Worked Example:   How to extract domain name from URL in Excel

Working from the inside out, we use the FIND function to get the position of the colon in the text, then add 1 to take into account the space that follows the colon. The result (a number) is plugged into the REPLACE function for the “num_chars” argument, which represents the number of characters to replace.

Worked Example:   Get first name from name with comma -- Manipulating NAMES in Excel

The REPLACE function then replaces the text from 1 to “colon + 1” with “”. In the example shown, the solution looks like this:

=REPLACE(B6,1,FIND(":",B6)+1,"")
=REPLACE(B6,1,6,"")
=2016

Post navigation

Previous Post:

Remove file extension from filename in Excel

Next Post:

Remove leading and trailing spaces from text in one or more cells 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

Logical Functions

  • IF, AND, OR and NOT Functions Examples in Excel
  • How to use Excel TRUE Function
  • How to use Excel NOT Function
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • Invoice status with nested if in Excel

Date Time

  • WORKDAY function: Description, Usage, Syntax, Examples and Explanation
  • How to get same date next year or previous year in Excel
  • Count day of week between dates in Excel
  • Display Date is workday in Excel
  • WEEKDAY function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • How to randomly assign people to groups in Excel
  • Map text to numbers in Excel
  • How to randomly assign data to groups in Excel
  • Map inputs to arbitrary values in Excel
  • Running count group by n size in Excel

General

  • How to Create Calendar in Excel
  • Check if multiple cells have same value in Excel
  • 231 Keyboard Shortcut Keys In Excel
  • Sum by group in Excel
  • How to generate random number between two numbers in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning