+ Reply to Thread
Results 1 to 8 of 8

COUNTIF but not strikeout

  1. #1
    Registered User
    Join Date
    03-08-2015
    Location
    Murfreesboro, TN
    MS-Off Ver
    2013
    Posts
    6

    COUNTIF but not strikeout

    First off, I love this forum, you guys are great.

    With that said is there a way to use countif to evaluate a cell and then count those cells unless they have strikethrough formatting?

    Example: (Imagine the bold is strikethrough....I couldn't figure out the code for that....[s][/s] didn't work.)
    A
    B
    1 dog beagle
    2 dog mutt
    3 cat tabby
    4 dog lab
    5 dog mix breed
    6 dog runt

    I need to count the rows with dog but not dog. If that makes sense. It should return 2.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: COUNTIF but not strikeout

    is there a way to use countif to evaluate a cell and then count those cells unless they have strikethrough formatting?
    Short answer - no, not with regular formulas. formulas work on data, formatting is cosmetic, not data.

    If there is some logic behind the formatting (whatever it might be), we may be able to base the count on that?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    03-08-2015
    Location
    Murfreesboro, TN
    MS-Off Ver
    2013
    Posts
    6

    Re: COUNTIF but not strikeout

    Basically, I have an inventory spreadsheet that has a 'cameras' worksheet with a list of cameras and their serial numbers. Based on that I have a 'material used' worksheet that has the same listing as the 'cameras' worksheet so that when you use one of the cameras you mark it with a job number and date used and it strikesthrough that camera on the 'cameras' worksheet. So now I want just a general overview 'inventory' worksheet with the amount of a specific type of camera is on hand.

    I know that is confusing so I am attaching the spreadsheet so you can kind of see what I am talking about.

    ASG Inventory.xlsx

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: COUNTIF but not strikeout

    So from your last post I gather you want a simple count of what's still available that is listed "unused" in the Material Used sheet.

    Try this formula in D3 of Inventory sheet.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 03-09-2015 at 03:23 AM.

  5. #5
    Registered User
    Join Date
    03-08-2015
    Location
    Murfreesboro, TN
    MS-Off Ver
    2013
    Posts
    6

    Re: COUNTIF but not strikeout

    That's exactly what i needed it to do. Thanks for the assistance.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: COUNTIF but not strikeout

    You're welcome. Glad it helped. Thanks for the feedback and the rep!

  7. #7
    Registered User
    Join Date
    02-01-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    4

    Re: COUNTIF but not strikeout

    I seek an answer to the original question: a COUNTIF that doesn't count Strikethroughs. I searched and searched to no avail. This thread is the closest to what I'd like

    I understand it would be a VBA function. I found one to CountNoStrike, but it counts ALL cells without a strikethrough in the range, not just those I wish to COUNTIF - so it's a problem if a "cat" row is also a strikethrough

    Public Function CountNoStrike(pWorkRng As Range) As Long
    'Update 20140819
    Application.Volatile
    Dim pRng As Range
    Dim xOut As Long
    xOut = 0
    For Each pRng In pWorkRng
    If Not pRng.Font.Strikethrough Then
    xOut = xOut + 1
    End If
    Next
    CountNoStrike = xOut
    End Function

    It would be like: COUNTIFnoStrike( A1:A6, "dog" ) and it would return a value of 2 for the example above.

    Thanks in advance!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: COUNTIF but not strikeout

    DoNoEvil welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    (also, please use code tags when posting code - see my footnote on how to use them )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Combining a Date Range COUNTIF and a general COUNTIF
    By jacobtom in forum Excel General
    Replies: 1
    Last Post: 09-15-2011, 05:06 PM
  2. Adding a CountIF to a formula that is already Countif
    By Cmorgan in forum Excel General
    Replies: 4
    Last Post: 06-01-2011, 09:34 AM
  3. Strikeout whole row based on column F
    By melbourne in forum Excel General
    Replies: 2
    Last Post: 07-17-2007, 09:12 AM
  4. sumif when not strikeout and secodn column is not 0
    By FrankB in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-29-2006, 11:53 AM
  5. Replies: 1
    Last Post: 08-16-2006, 09:40 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1