Log in  \/ 
x
or
x
x
Register  \/ 
x

or

How to sort or filter data by strikethrough in Excel?

In Excel, we often format the data with strikethrough to indicate the items are no longer required. And sometimes, we need to filter or sort the data which containing the strikethrough, so that we can quickly deal with these rows. Is there any quick tricks for us to sort or filter the data by strikethrough?

Sort or filter data by strikethrough with User Defined Function

Filter data by strikethrough with Kutools for Excel


Filter data by strikethrough quickly and easily:

Kutools for Excel's Filter Strikethrough utility can help you to filter all cells which are formatted as strikethrough quickly and easily.

doc-sort-by-strikethrough 14

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


arrow blue right bubble Sort or filter data by strikethrough with User Defined Function


Unfortunately, there is no direct way for us to sort or filter the strikethrough data by using Sort or Filter function, but, we can create a simple User Defined Function to mark the data with strikethrough first, and then apply the sort or filter feature.

Supposing I have the following range of data with strikethrough as screenshot shown, you can sort or filter the strikethrough data with following steps:

doc-sort-by-strikethrough1

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

Function HasStrike(Rng As Range) As Boolean
HasStrike = Rng.Font.Strikethrough
End Function

3. Then save and close this the window, in a blank cell beside your data, please enter this formula =HasStrike(A2), in this case, I will enter it to cell C2. See screenshot:

doc-sort-by-strikethrough1

Note: In the above formula, A2 is the value that you need to identify if it is formatted as strikethrough. You can change it as your need.

4. Then drag the fill handle over to the cells that you want to apply this formula. As the following screenshot shown, you can see, if the data is formatted as strikethrough, it is displayed as TRUE, and the normal data is displayed as FALSE.

doc-sort-by-strikethrough1

5. Then you can sort or filter by this new column C.

A: Sort the strikethrough data at bottom or top of the records:

(1.) Click Data > Sort, see screenshot:

doc-sort-by-strikethrough1

(2.) Then in the popped out Sort Warning dialog, check Expand the selection option.

doc-sort-by-strikethrough1

(3.) And click Sort button, in the Sort dialog box, choose Column C which is your new created column from Column drop down list, and then choose Values under the Sort On option, finally select the Order you would like to sort. See screenshot:

doc-sort-by-strikethrough1

(4.) Then click OK to close this dialog, and the strikethrough data has been sorted at the bottom of the value. See screenshot:

doc-sort-by-strikethrough1

Tip: If you want to sort the strikethrough data to the top of all the data, you just choose Largest to Smallest in step 3.

B: Filter the records by strikethrough

(1.) Select your whole data range, here I select range A1 : C14, and click Data > Filter, see screenshot:

doc-sort-by-strikethrough1

(2.) Then click the drop down button beside cell C1, and then just check TRUE option only, see screenshot:

doc-sort-by-strikethrough1

(3.) Then click OK, and all the strikethrough data has been filtered.

doc-sort-by-strikethrough1

Note: After finishing the sort and filter, you can delete the value in Column C.


arrow blue right bubble Filter data by strikethrough with Kutools for Excel

If you have Kutools for Excel, with its Filter Strikethrough feature, you can quickly filter all cells which are formated as strikethrough.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days. 

After installing Kutools for Excel, please do as this:

1. Select the column that you want to filter cells with strikethrough, and then click Kutools Plus > Special Filter > Filter Strikethrough, see screenshot:

doc-sort-by-strikethrough1

2. And then, a prompt box will pop out to remind you how many cells are matched witht the criteria, see screenshot:

doc-sort-by-strikethrough1

3. Then click OK button, all cells which are formated with strikethrough  are filtered out, see screenshot:

doc-sort-by-strikethrough1

Click Download Kutools for Excel and free trial Now!


Related articles:

How to sort rows by odd or even numbers in Excel?

How to sort rows to put the blank cells on top in Excel?

How to sort data by the most frequent value in Excel?

How to sort email address by domain in Excel?


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

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!
officetab bottom
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Nat · 1 years ago
    This is perfect, thank you!
  • To post as a guest, your comment is unpublished.
    Niko · 1 years ago
    Well done, thank you!
  • To post as a guest, your comment is unpublished.
    Rix · 2 years ago
    You can filter with MS Excel without having to do this script.
    Just Ctrl-F Find, Search by Format, Strikethrough checkbox, Find All, Then Select All (Crtl-A), then hide (Crtl-9).
    • To post as a guest, your comment is unpublished.
      Phil · 7 months ago
      I tried this but it crashed, seems when there is a lot of data it is really slow
  • To post as a guest, your comment is unpublished.
    Dawn · 3 years ago
    I'm getting #NAME? instead of True or False
  • To post as a guest, your comment is unpublished.
    Dawn · 3 years ago
    I tried this and I first got a message that my sheet needed to be saved as one with macros.
    I saved it as xlsm
    Then I pasted the =HasStrike(A2) and it gave me #NAME? in the cell.
    What am I doing wrong?
    Thnaks!
  • To post as a guest, your comment is unpublished.
    HS · 3 years ago
    Thanks a bunch for this, you have saved me a few hours of manual labour!
    • To post as a guest, your comment is unpublished.
      Sinan · 3 years ago
      well that worked perfectly. Thank you very much
  • To post as a guest, your comment is unpublished.
    Don · 3 years ago
    well that worked perfectly. THANKS.
  • To post as a guest, your comment is unpublished.
    Adib · 3 years ago
    Thank you very much! This saved my day!
  • To post as a guest, your comment is unpublished.
    Katia · 3 years ago
    Thank you!!!
    Exactly what I need ;)
  • To post as a guest, your comment is unpublished.
    TG · 3 years ago
    This surprisingly helped!! THANKS ALOT !
  • To post as a guest, your comment is unpublished.
    Nuno Ferreira · 4 years ago
    It worked great!
    Thanks for the tips!!!
  • To post as a guest, your comment is unpublished.
    Nuno Ferreira · 4 years ago
    It worked great!
    Thanks alot!
  • To post as a guest, your comment is unpublished.
    Paula · 4 years ago
    This was very helpful and exactly what I needed. Thanks!!
  • To post as a guest, your comment is unpublished.
    Matt P · 4 years ago
    This was awesome and saved me hours, thank you.
  • To post as a guest, your comment is unpublished.
    Purvi · 4 years ago
    Brilliant this was very helpful.
    Thanks :-)
  • To post as a guest, your comment is unpublished.
    Evan · 4 years ago
    This is awesome...but...I would also like to work it if ANY portion of the text in the cell contains a strikethrough. This code works ONLY if the ENTIRE cell has been "struck out". How would this code need to be modified to accomplish this??
    • To post as a guest, your comment is unpublished.
      HS · 3 years ago
      Good question, I faced same issue.

      Temporary Workaround - The cell with text which hasn't been completely stricken through creates a (#VALUE!) error as opposed to (TRUE) statement but you can still use this Value Error to identify the cells with strikethroughs.
  • To post as a guest, your comment is unpublished.
    JT · 5 years ago
    This was very very helpful!

    Thank you!
  • To post as a guest, your comment is unpublished.
    Avishek · 5 years ago
    Great.. Thanks a ton..