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

Data Analysis

  • How to add Trendline to a chart in Excel
  • How to count table columns in Excel
  • Example of COUNTIFS with variable table column in Excel
  • Filter Data Based on Date in Excel
  • How to create Checklist in Excel

References

  • How to get last row in mixed data with blanks in Excel
  • How to retrieve first match between two ranges in Excel
  • Basic INDEX MATCH approximate in Excel
  • How to get address of named range in Excel
  • Excel Advanced Lookup using Index and Match Functions

Data Validations

  • Excel Data validation allow weekday only
  • Excel Data validation with conditional list
  • Prevent invalid data entering in specific cells
  • Excel Data validation date in specific year
  • Excel Data validation exists in list

Extract word that begins with specific character in Excel

by

To extract words that begin with a specific character, you can use a formula based on six functions: TRIM, LEFT, SUBSTITUTE, MID, LEN, and REPT. This approach is useful if you need to extract things like a Twitter user name from a cell that contains other text.

Formula

=TRIM(LEFT(SUBSTITUTE(MID(text,FIND("@",
txt),LEN(text))," ",REPT(" ",100)),100))

Note: 100 represents the longest word you expect to find that begins with the special character. Increase or decrease to suit your needs.

Explanation

In the example shown, the formula in C5 is:

=TRIM(LEFT(SUBSTITUTE(MID(B5,FIND("@",
B5),LEN(B5))," ",REPT(" ",100)),100))

How this formula works

Starting from the inside out, the MID function is used to extract all text after “@”:

MID(B5,FIND("@",B5),LEN(B5))

The FIND function provides the starting point, and for total characters to extract, we just use LEN on the original text. This is a bit sloppy, but it avoids having to calculate the exact number of characters to extract. MID doesn’t care if this number is bigger than the remaining characters,  it simply extracts all text following “@”.

Next, we “flood” the remaining text with space characters, by replacing any single space with 100 spaces using a combination of SUBSTITUTE and REPT:

SUBSTITUTE("@word and remaining 
text"," ",REPT(" ",100))

This seems crazy, but the logic becomes clear below.

Next, to extract just the word we want (i.e. @word), we use LEFT to extract the first 100 characters from the left. This gets us “@word”, plus many extra spaces. To visualize, the hyphens below represent spaces:

@word———————

Now we just need to remove all extra spaces. For that, we use the TRIM function.

 

Post navigation

Next Post:

Create One-dimensional and Two-dimensional Array

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

  • How to use Excel XOR Function
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel FALSE Function

Date Time

  • DATE function: Description, Usage, Syntax, Examples and Explanation
  • Calculate total hours that fall between two times in Excel
  • How to calculate project start date based on end date in Excel
  • Get date from day number in Excel
  • List holidays between two dates in Excel

Grouping

  • Group numbers with VLOOKUP in Excel
  • If cell contains one of many things in Excel
  • Map text to numbers in Excel
  • Group times into unequal buckets in Excel
  • How to randomly assign data to groups in Excel

General

  • Creating and Opening an existing file in Excel
  • How to calculate profit margin percentage in Excel
  • How to add sequential row numbers to a set of data in Excel
  • How to calculate project complete percentage in Excel
  • How to get original number from percent change in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning