Consulting

Results 1 to 9 of 9

Thread: Subtotal??

  1. #1

    Subtotal??

    vbaexpresshelp1.xlsm

    Im in need of a formula that only includes visible rows so that I can use filters on my sheet to refine an outcome.

    attached is sample sheet if anyone can help.

    Thanks

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    No data to test this on.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Quote Originally Posted by mdmackillop View Post
    No data to test this on.
    Not sure what you're looking at but there is data in the sheet where it is needed

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    Quote Originally Posted by plasteredric View Post
    Not sure what you're looking at but there is data in the sheet where it is needed
    He's looking at your attached file. There's no data to test this on.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    He's looking at your attached file. There's no data to test this on.
    If you look at the attached pic there is data in the cells that are to be referenced
    Attached Images Attached Images
    Last edited by plasteredric; 10-16-2017 at 10:49 AM.

  6. #6
    I have this formula for cell 'AH6' which works to count the number or instances in the column, i just don't know how to only count the rows where there is a value in the AH column

    =SUMPRODUCT(($Q$30:$Q$9999=$Y6)*(SUBTOTAL(103,OFFSET($Q$30,ROW($Q$30:$Q$999 9)-MIN(ROW($Q$30:$Q$9999)),0))))

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    Not 100% sure what you're after but test this in AH6 copied down and across:
    =SUMPRODUCT(SUBTOTAL(3,OFFSET(AH$30,ROW(AH$30:AH$99924)-ROW(AH$30),0)),--($Q$30:$Q$99924=$Y6))

    Also test 103 instead of 3.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  8. #8
    Quote Originally Posted by p45cal View Post
    Not 100% sure what you're after but test this in AH6 copied down and across:
    =SUMPRODUCT(SUBTOTAL(3,OFFSET(AH$30,ROW(AH$30:AH$99924)-ROW(AH$30),0)),--($Q$30:$Q$99924=$Y6))

    Also test 103 instead of 3.
    Thanks, works a treat

  9. #9
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    While I have no doubt the solution works, I would not regard testing on 3 unique items a real "test". What is the issue in providing a realistic data sample? Personally, I'm not going to spend my time filling in random data for testing results.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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