how to remove text before or after a specific character in excel?

Learn Microsoft Excel Online FreeMenuExcel HomeExcel BasicsExcel FunctionsExcel TemplatesExcel Pivot TableExcel ChartsExcel VBAExcel ExamplesExcel VLOOKUP Example600+ Basic Excel F

how to remove text before or after a specific character in excel?

Learn Microsoft Excel Online FreeMenu




  • Excel Home
  • Excel Basics
  • Excel Functions
  • Excel Templates
  • Excel Pivot Table
  • Excel Charts
  • Excel VBA
  • Excel Examples
  • Excel VLOOKUP Example
  • 600+ Basic Excel Formulas & Functions with Examples
  • Google Sheets
  • Google Sheets Functions
  • Google Sheets Templates
  • Contact Us

DONATE

How to remove text after a specific [email protected] 31, 2017Excel Examples

We talked that how to remove all characters before the first match of the comma character in the previous post. And this post will teach you how to remove text after the first occurrence of the comma character in a text string in excel.

Table of Contents

  • Remove text after a specific character
  • Remove Text after a specific character using FIND&Select command
  • Related Formulas
  • Related Functions

Remove text after a specific character

If you want to remove all characters after the first match of the comma character in a text string in Cell B1, you can create an excel formula based on the LEFT function and FIND function.

You can use the FIND function to get the position of the first occurrence of the comma character in a text in B1, then using the LEFT function to extract the left-most characters before the first comma. So you can remove the text after the first comma character in text. You can use the following formula:=LEFT(B1,FIND(",",B1)-1)

Lets see how this formula works:

=FIND(,,B1)-1

This formula returns the position of the first match of the comma character in a text string in Cell B1, then subtract 1 by the position number to get the length of substring before the first comma, so it returns 5. And the returned value goes into the LEFT function as its num_chars argument.

=LEFT(B1,FIND(,,B1)-1)

This formula extracts the left-most 5 characters from a text string in Cell B1.

So you can see that all characters after the first comma character in a text string are removed.

Remove Text after a specific character using FIND&Select command

You can also use the Find and Replace command to remove text after a specified character, just refer to the following steps:

1# Click HOME->Find&Select->Replace, then the window of the Find and Replace will appear.

2# click Replace Tab, then type ,* into the Find what: text box, and leave blank in the Replace with: text box.

3# click Replace All

you will see that all characters after the first comma character are removed.


  • Remove text before the first match of a specific character
    If you want to remove all characters that before the first occurrence of the comma character, you can use a formula based on the RIGHT function, the LEN function and the FIND function..
  • Extract word that starting with a specific character
    Assuming that you have a text string that contains email address in Cell B1, and if you want to extract word that begins with a specific character @ sign, you can use a combination with the TRIM function, the LEFT function, the SUBSTITUTE function .
  • Extract text before first comma or space
    If you want to extract text before the first comma or space character in cell B1, you can use a combination of the LEFT function and FIND function.
  • Extract text after first comma or space
    If you want to get substring after the first comma character from a text string in Cell B1, then you can create a formula based on the MID function and FIND function or SEARCH function .
  • Extract text before the second or nth specific character
    you can create a formula based on the LEFT function, the FIND function and the SUBSTITUTE function to Extract text before the second or nth specific character
  • Extract text after the second or nth specific character (space or comma)
    If you want to extract text after the second or nth comma character in a text string in Cell B1, you need firstly to get the position of the second or nth occurrence of the comma character in text, so you can use the SUBSTITUTE function to replace
  • Excel LEFT function
    The ExcelLEFTfunction returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.TheLEFTfunction is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of theLEFTfunction is as below:=LEFT(text,[num_chars])t)
  • Excel FIND function
    The Excel FIND function returns the position of the first text string (sub string) within another text string.The syntax of the FINDfunction is as below:= FIND(find_text, within_text,[start_num])Related Posts

How to Get Text before or after Dash Character in Excel

This post will guide you how to get text before or after dash character in a given cell in Excel. How do I extract text string before or after dash character in Excel. Get Text before Dash Character with Formula ...How to Insert Dashes in Phone Numbers in Excel

This post will guide you how to insert or add dashes in phone number with a formula in Excel. How do I add dashes to telephone numbers in a selected range in Excel. How to separate numbers with dashes in ...Extract Email Address from Text

This post will guide you how to extract email address from a text string in Excel. How do I use a formula to extract email address in Excel. How to extract email address from text string with VBA Macro in ...Insert Character or Text to Cells

This post will guide you how to insert character or text in middle of cells in Excel. How do I add text string or character to each cell of a column or range with a formula in Excel. How to ...Get Workbook Path Only

This post will guide you how to get the current workbook path in Excel. How do I insert workbook path only into a cell with a formula in Excel. Get workbook path with Document Location You can get the workbook ...

Other postsHow to remove text before the first match of a specific character «» How to replace all characters before the first specific characterSidebar




Ezoic

report this ad

Recent Posts

  • Phone Number Format in Excel
  • Check Cell If Contains One of Many with Exclusions
  • If Cell Contain Specific Text
  • Cell Contains Number
  • Categorize Text With Keywords
  • Cash Denomination Calculator
  • 7 Best Free Weekly/Bi-Weekly Budget Template
  • COUNTIF Function: Everything You Need To Know
  • Free Family Budget Template (Step-by-step Guide)
  • 7 Basic Formulas And Functions parameters You NEED to KNOW

©Copyright 2017-2022Excel How All Rights Reserved.|  Privacy Policy  |  Term Of Service  |  RSSxx

Video liên quan