Filter for length of text

FredMFoley

Board Regular
Joined
Mar 18, 2002
Messages
58
Can you use filtering to select text of a given length - eg 3 characters long? (or is VBA needed)
Thank You
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
You can do this without VBA, using an AutoFilter. For the criteria, select "Custom". In the Custom AutoFilter dialog box's first field, choose "equals", and in the criteria field to the right of that, enter three question marks (???), to represent 3 characters as in your specific example. That will filter for cells in that column containing 3 characters.
 
Upvote 0
For even more flexibility you could create a second column with the following formula in it:

=len([firstcolumn,firstrow])

then pull that formula down to all the rows containing the data.

This will give you the length of each entry in the column containing your data. You can then custom filter on the length. You can set the filter to show you rows which have less than, less than or equal to, greater than, greater than or equal to, or between a certain number of characters. So this filter is set on the column containing the lenght formulas but effects the column containing your data.
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top