To extract text from a specific starting point to the very end of a string in Excel, use the MID function combined with the LEN function: =MID(text, start_num, LEN(text)). Because the MID function requires a specific number of characters to extract, using the LEN function as the third argument ensures that Excel captures every remaining character regardless of how long the cell content is.
What You'll Need
- Microsoft Excel (any version, including Office 365, Excel 2021, 2019, or Excel Online).
- A dataset containing text strings from which you need to extract a trailing portion.
- A basic understanding of how to enter formulas into a cell.
Step-by-Step
- Identify your source data: Locate the cell containing the text you want to truncate. For this guide, assume your text is in cell A2.
- Determine the starting position: Decide exactly where the extraction should begin. If you want to start from the 5th character, your
start_numwill be 5. If the starting point is dynamic (e.g., after a specific character like a hyphen), you will need to use the FIND function to locate that character first. - Enter the MID function: Click on the cell where you want the result to appear and type
=MID(A2,. - Insert the start number: Type the number of the character where the extraction begins. For example, if you want everything from the 6th character onwards, type
6,. Your formula now looks like=MID(A2, 6,. - Add the LEN function for the end of the string: Since the MID function normally requires a fixed number of characters (e.g., 10 or 20), but your strings may vary in length, you must tell Excel to take "everything else." Type
LEN(A2))and press Enter. The final formula is=MID(A2, 6, LEN(A2)). - Verify the result: Check the output cell. Excel will start at character 6 and continue until it reaches the total length of the string, effectively capturing everything to the end.
- Apply to the rest of the column: Hover your mouse over the bottom-right corner of the cell (the fill handle) until a small black cross appears. Click and drag downward to apply the formula to all other rows in your dataset.
Common Mistakes
One of the most frequent errors is forgetting the third argument in the MID function. Many users assume that leaving the third argument blank or omitting it will tell Excel to "just go to the end." However, the MID function requires three arguments: the text, the start position, and the number of characters. If you omit the third argument, Excel will return a formula error.
Another common mistake is a "off-by-one" error. This happens when a user wants to extract everything after a specific character (like a space or a comma) but uses the exact position of that character as the start_num. For example, if a comma is at position 5 and you use =MID(A2, 5, LEN(A2)), the result will include the comma. To get everything after the comma, you must use 5 + 1 as your starting point.
Users also sometimes confuse the MID function with the RIGHT function. While RIGHT also extracts from the end, it requires you to specify how many characters to take from the right side. If you don't know the exact length of the prefix you are removing, the MID/LEN combination is far more reliable than trying to calculate the RIGHT function's arguments.
Tips
Using FIND for Dynamic Starts: In real-world data, the starting point is rarely a fixed number. For instance, if you have a list of emails and want everything after the "@" symbol, you can nest the FIND function inside the MID function. The formula would be =MID(A2, FIND("@", A2) + 1, LEN(A2)). This tells Excel to find the position of the "@" symbol and start extracting one character after that point.
Handling Leading/Trailing Spaces: Sometimes your extracted text might look correct but contain invisible spaces at the beginning or end. To clean this up, wrap your entire formula in the TRIM function: =TRIM(MID(A2, 6, LEN(A2))). This ensures that any accidental whitespace is removed, which is critical if you plan to use the extracted text in a VLOOKUP or MATCH function later.
Converting to Static Values: Once you have extracted the text you need, the cells still contain formulas. If you delete the original source column, your extracted data will break (showing #REF!). To prevent this, select your results, copy them (Ctrl+C), right-click the same area, and choose Paste Special > Values. This replaces the formulas with the actual text strings.
Troubleshooting
The formula returns a #VALUE! error: This usually happens if the start_num is not a number or if the text reference is invalid. Ensure that your cell references (like A2) are correct and that you haven't accidentally typed a letter where a number should be. If you are using the FIND function, a #VALUE! error occurs if the character you are searching for does not exist in the cell.
The result is blank: If the start_num is greater than the total length of the string in the cell, Excel will return an empty string. Check your source data to ensure the cell isn't empty and verify that your starting position is actually within the bounds of the text length.
The result includes characters I didn't want: This is almost always a starting position issue. If you see one extra character at the start of your result, increase your start_num by 1. If you are missing the first character of your desired string, decrease the start_num by 1.
The formula isn't updating: If you change the source text but the MID result doesn't change, your workbook might be set to Manual Calculation mode. Go to the Formulas tab, click Calculation Options, and ensure Automatic is selected.
Frequently Asked Questions
Can I use this to remove the first few characters of a cell?
Yes, that is exactly what this method does. By setting the start_num to the position immediately after the characters you want to remove, you effectively strip the prefix and keep the rest of the string.
Why not just use the RIGHT function?
The RIGHT function requires you to know how many characters you want from the end. To use RIGHT to remove the first 5 characters, you would have to write =RIGHT(A2, LEN(A2)-5). While this works, the MID function is often more intuitive for users who think in terms of "start here and take everything else."
Does the LEN function count spaces?
Yes, the LEN function counts every single character in the cell, including spaces, punctuation, and special characters. This is why the MID/LEN combination is so effective; it accounts for every single character regardless of what it is.
Will this work on numbers?
Yes, but Excel treats the number as a text string when using MID. If you need the result to be a number for mathematical calculations, you can wrap the entire formula in the VALUE function: =VALUE(MID(A2, 6, LEN(A2))).
Is there a limit to how many characters MID can extract?
The MID function can handle strings up to 32,767 characters, which is the maximum limit for a single cell in Excel. For the vast majority of business and data analysis tasks, you will never hit this limit.