+ Reply to Thread
Results 1 to 4 of 4

Update COUNTIF Formula When Using Tables

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    48

    Update COUNTIF Formula When Using Tables

    I'd like the formulas to update based on the filtered data I have in my table. In the example, if I choose under column C "Date Shipped" all January dates I would want the quantities in A2:A4 to update. Then if I choose February update again and so on. I've been using a variety of various attempts but nothing has worked. The example sheet is attached and thanks in advance!
    Attached Files Attached Files
    Last edited by robstark; 07-14-2018 at 07:40 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    45,387

    Re: Update COUNTIF Formula When Using Tables

    Your 2-4 days is wrong. The way you have that formula set up...
    =(COUNTIF(F7:F12,">=2")+COUNTIF(F7:F12,"<4"))
    it is counting all values >=2 PLUS all values <4
    If you break it down into 2 formulas you will see 4 + 4

    Try these instead
    A2=SUMPRODUCT(SUBTOTAL(3,OFFSET($A$7,ROW($A$7:$A$12)-ROW($A$7),)),--($F$7:$F$12<=1))
    A3=SUMPRODUCT(SUBTOTAL(3,OFFSET($A$7,ROW($A$7:$A$12)-ROW($A$7),)),--(F7:F12>=2),--(F7:F12<=4))
    A4=SUMPRODUCT(SUBTOTAL(3,OFFSET($A$7,ROW($A$7:$A$12)-ROW($A$7),)),--($F$7:$F$12>=5))

    Keep in mind you have 6 entries, so te combination of ANY counts that you do, cannot exceed that, else you are including entries more than once
    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

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Update COUNTIF Formula When Using Tables

    Thanks- this is perfect!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    45,387

    Re: Update COUNTIF Formula When Using Tables

    Happy to help and thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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