Skip to main content

How to filter cells by length of text in Excel?

Author Kelly Last modified

Filtering cells by text length in Excel is a common need when processing and analyzing data. By filtering for text of a specific length, you can quickly locate content with a certain number of characters, such as limiting the length of input or extracting key data. Here are several methods to accomplish this, whether using built-in features or formulas, to make the task simple and efficient.


Filter cells by given text length with Filter command

You can filter cells by given text length (the number of characters) with Text Filter’s Custom Filter function. Please process as follows:

  1. Select the column data that you want to filter, and click the "Filter" button under "Data" tab.
  2. Click the "Filter Arrow", and move mouse over the "Text Filters" item, and choose the "Custom Filter" item. See the following screenshot:
    choose the Custom Filter item from Filter list box
  3. In the popping up "Custom AutoFilter" dialog box, specify the criteria as "Equals", and enter 16 question marks to indicate the length.:
    specify the criteria in the Custom AutoFilter dialog box
  4. Click "OK", the cells with 16 characters in the column are filtered.

Easily filter cells by text length (equal to / less than / greater than) using Kutools for Excel

In this section, we’ll explore how to use "Kutools for Excel" to filter cells based on text length—whether equal to, less than, or greater than a specific number, with just a few clicks—no formulas or helper columns required.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...
  1. Select the range of data you want to filter. Click "Kutools Plus" > "Super Filter" to open the "Super Filter" pane.
  2. In the pane, set the filter criteria in the criteria box as you need:
    In the first criteria box, select the column header that you want to filter;
    In the second criteria box, choose "Text";
    In the third criteria box, select the condition: "Length is" , "Length is greater than", or "Length is less than".
    In the last criteria box, enter the desired text length (e.g., "16" for exactly 16 characters).
    specify the criteria in the Super Filter pane
  3. Then, click "Filter" button apply the conditions. The results will be displayed in the selected range. See screenshot:
    click Filter button to get the result
Tips: If you want to filter cells with text length greater than 16 characters but less than 18 characters, simply set the relationship between the two conditions to "AND".

set criteria for filter by multiple criteria


Filter cells by text length (equal to / less than / greater than) using helper column

In this section, we’ll walk you through how to set up a helper column, calculate text lengths using the LEN function, and apply filters to extract the desired data. This method is simple and effective for scenarios where you need to identify cells with text that is equal to, less than, or greater than a specific number of characters.

  1. In a help column, enter the below formula, and then, drag the fill hanlde down to fill the formula to other cells. All charatcer length of each cell is calclated.
    =LEN(A2)
    apply len function to get the charatcer length
  2. Select the helper column, and click the "Filter" button under "Data" tab.
  3. In the drop down box, select "Number Filters", and then, choose the criteira that you need from the expanded list box, see screenshot:
    choose the criteira from Number Filters section
  4. In the following "Custom Autofilter" box, set the number of characters that you want to filter based on, see screenshot:
    set the number of chanratcers to filter based on
  5. Click "OK" to get the filter result.

Filter cells by text length (equal to / less than / greater than) using FILTER function

If you have Excel 365 or Excel 2021 and later versions, its new FILTER function is a powerful tool for dynamic filtering of data based on specific conditions. One of its versatile applications is filtering cells by the length of text, whether equal to, less than, or greater than a certain number of characters.

Filter Cells with Text Length Equal to a Specific Number

To filter cells where the text length is exactly 15 characters, please apply the below formula, and press Enter key to get the result:

=FILTER(A2:A19, LEN(A2:A19)=15, "No Match")

Filter cells by text length with FILTER function

Filter Cells with Text Length Less Than a Specific Number

To filter cells with text length less than 15, please apply the below formula:

=FILTER(A2:A19, LEN(A2:A19)<15, "No Match")

Filter Cells with Text Length Greater Than a Specific Number

To filter cells with text length greater than 15, please apply the below formula:

=FILTER(A2:A19, LEN(A2:A19)>15, "No Match")

Filter Cells Within a Range of Text Lengths

To filter cells with text length greater than 16 but less than 20:

=FILTER(A2:A19, (LEN(A2:A19)>16)*(LEN(A2:A19)<20), "No Match")

In summary, filtering cells by text length in Excel can be accomplished through various methods, each catering to different levels of complexity and user preferences. By choosing the method that best suits your needs, you can efficiently organize and analyze your data with minimal effort. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials.

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!