+ Reply to Thread
Results 1 to 11 of 11

Is there a way to not include data from hidden rows in the following formula?

  1. #1
    Registered User
    Join Date
    07-09-2018
    Location
    Columbus, OH
    MS-Off Ver
    16
    Posts
    2

    Question Is there a way to not include data from hidden rows in the following formula?

    Is there a way to not include data from hidden rows in the following formula? Or a better formula?

    =COUNTIF('MMI Tailoring Outline'!E:E,"Mechanical")

    and

    =SUM(COUNTIFS('MMI Tailoring Outline'!E:E,"Mechanical",'MMI Tailoring Outline'!U:U,"Yes"))

  2. #2
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Is there a way to not include data from hidden rows in the following formula?

    There are several ways to achieve this. The easiest one is to have a (hidden) helper column on sheet 'MMI Tailoring Outline' -- say, column X.

    Place the following formula in cell X1 and drag-copy it down as needed: =SUBTOTAL(103,E1)

    Now, your formulas that will ignore data in hidden rows become:

    =COUNTIFS('MMI Tailoring Outline'!E:E,"Mechanical",'MMI Tailoring Outline'!X:X,1)

    =COUNTIFS('MMI Tailoring Outline'!E:E,"Mechanical",'MMI Tailoring Outline'!U:U,"Yes",'MMI Tailoring Outline'!X:X,1)

  3. #3
    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: Is there a way to not include data from hidden rows in the following formula?

    @ Root_

    Check this on a few trials. With this method I've encountered occasional failures to filter out deselected items.

    I'm not alone and I've not read where anyone seems to know why.

    Perhaps it's an idiosyncrasy of the 'Filter'.
    Dave

  4. #4
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Is there a way to not include data from hidden rows in the following formula?

    Hi Dave,

    I did an extensive testing of the two simple formulas on a dataset with 10,000 rows.
    Used filtering, row hiding, and grouping -- not a single glitch.

    If you have a workbook where this method occasionally fails, could you please post it?

  5. #5
    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: Is there a way to not include data from hidden rows in the following formula?

    I'll do my best to find it if it's still on my hard drive.

  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: Is there a way to not include data from hidden rows in the following formula?

    Root_

    I could only find one of the files.

    The helper formula is in D18:D26 and it is

    =SUBTOTAL(103,A18)

    Try filtering out Mary Sue. There will always be a Mary Sue left in the filtered data.

    This helper modification does not have that problem.

    =--OR(SUBTOTAL(103,A18),SUBTOTAL(103,C18))

  7. #7
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Is there a way to not include data from hidden rows in the following formula?

    Dave,

    I played with your workbook and my testing dataset and found the following, which does look like a glitch in the Filter implementation.

    Under certain conditions, the Filter does not see the last row with a SUBTOTAL(103,Ref) formula. That’s why Mary Sue stays in the filtered data.

    This glitch occurs only when the helper column is filterable. In your workbook, try setting the filter in range A17:C17 only, and Mary Sue can be filtered out.

  8. #8
    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: Is there a way to not include data from hidden rows in the following formula?

    So it does.

    Sharp eyes.

    Thanks for looking at this.

    Now the remaining question is why the second formula does work filterable.

  9. #9
    Registered User
    Join Date
    07-09-2018
    Location
    Columbus, OH
    MS-Off Ver
    16
    Posts
    2

    Re: Is there a way to not include data from hidden rows in the following formula?

    Quote Originally Posted by Root_ View Post
    There are several ways to achieve this. The easiest one is to have a (hidden) helper column on sheet 'MMI Tailoring Outline' -- say, column X.

    Place the following formula in cell X1 and drag-copy it down as needed: =SUBTOTAL(103,E1)

    Now, your formulas that will ignore data in hidden rows become:

    =COUNTIFS('MMI Tailoring Outline'!E:E,"Mechanical",'MMI Tailoring Outline'!X:X,1)

    =COUNTIFS('MMI Tailoring Outline'!E:E,"Mechanical",'MMI Tailoring Outline'!U:U,"Yes",'MMI Tailoring Outline'!X:X,1)
    Thank you for your help.

  10. #10
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Is there a way to not include data from hidden rows in the following formula?

    @ HTTR21: You are welcome.

    @ FlameRetired: Upon further digging, I found that filtering works without the last-row glitch if the single-subtotal formula is entered as =SUBTOTAL(103,Ref)+0

  11. #11
    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: Is there a way to not include data from hidden rows in the following formula?

    That's an interesting find. I've never known SUBTOTAL to require anything like that.

    Thanks for passing that one on as well.

+ 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. Replies: 3
    Last Post: 05-07-2015, 01:26 PM
  2. Replies: 2
    Last Post: 03-07-2015, 10:56 PM
  3. Replies: 1
    Last Post: 02-11-2015, 07:47 AM
  4. Don't include hidden cells in COUNTIF formula
    By sam94 in forum Excel General
    Replies: 14
    Last Post: 10-29-2014, 09:39 PM
  5. [SOLVED] Editing a Macro to include multiple rows and include text formatting for leading zeros
    By missmea2005 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2014, 09:50 AM
  6. Replies: 0
    Last Post: 01-15-2014, 05:17 PM
  7. [SOLVED] Creating a counter that does not include hidden rows
    By TechMGR in forum Excel General
    Replies: 1
    Last Post: 04-04-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