+ Reply to Thread
Results 1 to 21 of 21

Ignore strikethrough value

  1. #1
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    389

    Ignore strikethrough value

    Hi,
    I need a SUM of column that will ignore value that is strikethrough. Is that possible?
    My English is very poor, so please be patient >_<"

    Thanks & Regards.
    hkbhansali

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Ignore strikethrough value

    You'd need to use VBA to do that, either create a UDF or a macro. Would that be okay?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    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,946

    Re: Ignore strikethrough value

    short answer - no, not with formulas. strike-through is formatting/cosmetic, not data, formulas work with data. How is the strike-through being applied?
    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

  4. #4
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    389

    Re: Ignore strikethrough value

    Hi chemistB
    VBA or macro anything okay with me.

    Thanks

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,424

    Re: Ignore strikethrough value

    Please Login or Register  to view this content.
    e.g.

    =MySUM(A2:A50)

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Ignore strikethrough value

    Shouldn't you make that volatile?

    Application.Volatile
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    389

    Re: Ignore strikethrough value

    Hi john Topley

    how to do this ?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Ignore strikethrough value

    Even if it's volatile, it won't be responsive to formatting changes.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Ignore strikethrough value

    Yes, I know.

    But at least it will update upon the next calculation.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,424

    Re: Ignore strikethrough value

    @Tony, Of course ..!
    Last edited by JohnTopley; 02-09-2016 at 01:14 PM.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Ignore strikethrough value

    This is a perfect example of why calculations should not be based on formats!

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Ignore strikethrough value

    Amen, but there's no persuading -- people have to get bit to believe it.

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,424

    Re: Ignore strikethrough value

    @Tony .... but it is imperfect world ....

  14. #14
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Ignore strikethrough value

    So is that a given (except for instances which I can't even think of)
    "Whenever creating a UDF, make sure it is volatile." ?

  15. #15
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Ignore strikethrough value

    No -- most UDFs should not be volatile, for the same reason we avoid volatile functions, like INDIRECT and OFFSET.

  16. #16
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Ignore strikethrough value

    How to do this?
    ALT + F11 will open VBA Editor.
    Then Insert > Module
    Paste this code into the large white text box
    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    12-21-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    389

    Re: Ignore strikethrough value

    Yes,
    It's work....but it's possible that auto update this code ? (My sum is in column "E")

    Thanks a lot ChemistB
    Last edited by hkbhansali; 02-13-2016 at 09:38 AM.

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,424

    Re: Ignore strikethrough value

    Put the function in any cell

    =MySum(E2:e100)

    just as you would for =SUM(E1:E100)

  19. #19
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Ignore strikethrough value

    Quote Originally Posted by hkbhansali View Post
    It's work....but it's possible that auto update this code ?
    I'm assuming you've discovered that the formula doesn't update when you add/remove the strike-through to a cell?

    That's the reason you should not base calculations on cell formats.

    When you add/change a cell format that action does not trigger a calculation so any calculations based on that format will not update.

    In the thread we mentioned making the UDF volatile so that the formula would update when some event would trigger the NEXT sheet calculation.

    I think you'd be better off using some "marker" to define which cells should be summed rather than using the strike-through format which is not reliable.

    Something like this:

    Data Range
    A
    B
    C
    D
    1
    82
    293
    2
    62
    X
    3
    98
    X
    4
    91
    5
    34
    6
    47
    X
    7
    97
    8
    75
    9
    86
    X
    10
    53
    11
    ------
    ------
    ------
    ------


    Sum the values marked by "X"...

    =SUMIF(B1:B10,"X",A1:A10)

  20. #20
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,424

    Re: Ignore strikethrough value

    @tony: Couldn't agree more!

  21. #21
    Registered User
    Join Date
    03-04-2021
    Location
    WI, USA
    MS-Off Ver
    365
    Posts
    1

    Re: Ignore strikethrough value

    Tony Valco
    This was awesome!!! Thank you so much!!!

+ 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. [SOLVED] Strikethrough formatting
    By jrmcfall in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-08-2015, 06:31 PM
  2. Replies: 12
    Last Post: 07-04-2013, 07:26 AM
  3. If then strikethrough
    By kosheboy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-25-2013, 04:49 PM
  4. [SOLVED] Strikethrough a specified row
    By fatalcore in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-15-2012, 09:22 AM
  5. [SOLVED] strikethrough
    By herbzee in forum Excel General
    Replies: 7
    Last Post: 03-14-2006, 09:10 PM
  6. [SOLVED] Re:strikethrough
    By newbie in forum Excel General
    Replies: 2
    Last Post: 07-17-2005, 09:05 PM
  7. Strikethrough on Excel. How?
    By Jerry Baritone in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2005, 06:06 PM

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