Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula to Shorten Text Length

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can use the LEFT and RIGHT functions combined with LEN to shorten text in Excel. The core formula =LEFT(A1, LEN(A1)-4) removes the last four characters, while =RIGHT(A1, LEN(A1)-3) removes the first three. These formulas are useful for cleaning data, creating abbreviations, or truncating URLs and filenames to fit into limited columns.

What You'll Need

  • A computer with Microsoft Excel installed (2016, 2019, 2021, or Microsoft 365 versions are supported).
  • A spreadsheet containing the text data you wish to shorten.
  • Basic familiarity with Excel cell references (e.g., A1, B2) and formula syntax.

Step-by-Step

Follow these steps to create a formula that shortens text from either the beginning, the end, or both sides.

  1. Locate your data: Open your Excel workbook and navigate to the worksheet containing the text you want to shorten. Click on the cell where you want the shortened text to appear. This is often a new column next to your original data.

  2. Insert the formula: Type an equals sign (=) to begin the formula. For a text string in cell A1, the basic syntax to cut off the last four characters is =LEFT(A1, LEN(A1)-4). If you want to cut off the first three characters, use =RIGHT(A1, LEN(A1)-3). Type this into the formula bar or directly into the cell.

  3. Adjust the numbers: The numbers inside the parentheses represent the number of characters to keep or remove. In the example above, -4 tells Excel to subtract four characters from the total length before keeping the rest, effectively trimming the tail. You can change these numbers to fit your specific needs. For example, =LEFT(A1, 10) would simply cut the text to exactly 10 characters, regardless of the original length.

  4. Press Enter: Press the Enter key on your keyboard. Excel will calculate the result and display the shortened text in the cell. If the original text was shorter than the number of characters you asked to keep, Excel will simply return the entire original text without an error.

  5. Drag the fill handle: To apply the same formula to multiple rows, click on the cell containing your new formula. You will see a small square handle in the bottom-right corner of the cell. Click and drag this handle down to as many rows as you have data. Excel will automatically adjust the cell references (e.g., A1 becomes A2, A3, etc.) so that every row uses its own data.

  6. Copy and Paste Values (Optional): If you want to stop the formula from updating when you change the original data, you must convert the results to values. Click on the cell with the formula, press Ctrl+C to copy, then right-click on the same cell (or another cell) and select Paste Special > Values. This replaces the formula with the static text result.

Common Mistakes

  • Forgetting to subtract from the length: A common error is using =LEFT(A1, 5) when you want to remove the last few characters. This will simply keep the first five characters. To remove characters from the end, you must use =LEFT(A1, LEN(A1)-n), where n is the number of characters you want to cut.
  • Using text that is too short: If your source text is extremely short (e.g., "Hi"), and you try to remove more characters than exist (e.g., =LEFT(A1, LEN(A1)-5)), Excel will return a #VALUE! error. The formula attempts to calculate a negative number of characters to keep, which is impossible.
  • Not accounting for spaces: If you are shortening a URL or a code, ensure you aren't removing a trailing space that might be crucial. The formula counts spaces as characters, so removing the last four characters could also remove a space.

Tips

  • Combine LEFT and RIGHT: You can shorten text from both the beginning and the end simultaneously by nesting functions. For example, =TRIM(RIGHT(SUBSTITUTE(A1, " ", REPT(" ", 100)), 100)) is a complex way to remove the first 100 characters, but a simpler version for removing the first 3 and last 4 is =TRIM(RIGHT(LEFT(A1, LEN(A1)-4), LEN(A1)-7)). This keeps the middle section of the text.
  • Use TRIM for cleaner output: When shortening text, you might accidentally introduce extra spaces at the start, end, or between words. Use the =TRIM() function around your formula to remove these. For example, =TRIM(LEFT(A1, LEN(A1)-4)).
  • Use TEXT to remove leading zeros: If you are shortening text that represents a number and you want to keep it as text to preserve leading zeros, ensure the cell format is text before applying the formula. If the cell format is general or number, Excel may convert the result to a number and strip the leading zeros.

Troubleshooting

If your formula is not working as expected, check the following common issues.

  • Error: #VALUE! This error usually means your text is too short for the operation you are trying to perform. For instance, if you have a 2-character word and try to remove 3 characters, Excel cannot process a negative length. Check your source data to ensure it is longer than the number of characters you are trying to remove.
  • Text isn't shortening: If you change the number in the formula but the result doesn't update, ensure that Excel is set to automatically recalculate. Go to the Formulas tab on the ribbon and check that Automatic is selected under Calculation Options. If it is set to Manual, press F9 to calculate the sheet.
  • Formula is referencing the wrong cell: If you are dragging the fill handle and the new row is not using its own data, check the cell references in your formula. They should be relative (e.g., A1). If they are absolute (e.g., $A$1), dragging the handle will copy the same formula without changing the cell reference. Remove the dollar signs ($) to fix this.
  • Text is cutting off too much: Double-check your math. If you want to keep 10 characters and remove the last 5, your formula should be =LEFT(A1, LEN(A1)-5). If you enter =LEFT(A1, 10), you will only see the first 10 characters and won't see the part you tried to remove.

Frequently Asked Questions

Can I shorten text in Excel without using formulas?

Yes, you can use the Text to Columns feature. Select your column, go to the Data tab, and click Text to Columns. Choose Fixed width as the file type, and use the arrows to set break points where you want the text to split. This is useful if you want to split a single column into multiple columns based on a fixed length.

How do I shorten a text string to exactly 10 characters?

Use the =LEFT or =RIGHT function with a fixed number. For the first 10 characters, use =LEFT(A1, 10). For the last 10 characters, use =RIGHT(A1, 10). Note that =LEFT will cut off the rest of the text, while =RIGHT will cut off the beginning.

Why does my shortened text have a leading space?

This usually happens if you use =RIGHT to remove characters from the beginning. The space is the first character in the string. To remove it, simply add =TRIM() around your formula: =TRIM(RIGHT(A1, LEN(A1)-3)).

What is the difference between LEFT, RIGHT, and MID?

LEFT extracts characters from the start of the text, RIGHT extracts from the end, and MID extracts from the middle. MID requires two extra arguments: the starting position of the character you want to start with and how many characters to take.

Can I use this formula on dates?

Yes, but Excel will treat dates as numbers. If you want to display the shortened date as a date, you will need to apply a date format to the result cell after the formula is applied. If you want to remove parts of the date string (e.g., the year), use to keep the month and day.