+ Reply to Thread
Results 1 to 28 of 28

how to write COUNTIFS formula for testing only FILTERED data

  1. #1
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    how to write COUNTIFS formula for testing only FILTERED data

    hey my friends

    pls open the file which is attached
    in 2nd worksheet (2013_filtered) , u ll see my sales number only for 2013 but when i write the formula, u see result of COUNTIFS formula again for both 2012 and 2013 is 10 . but result should be 5 for only 2013 data.

    so how i should write "COUNTIFS" formula only for seen data in the table. i dont wanna "COUNTIFS" formula test hidden data when i filtered.
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Maybe this...

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(B2,ROW(B2:B23)-ROW(B2),0)),--(B2:B23>15000))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: how to write COUNTIFS formula for testing only FILTERED data

    =SUM(IF(SUBTOTAL(109,OFFSET(B1,ROW(A1:A22),0,1,1))>15000,1,0))

    as an array formula (confirm with ctrl+shift+enter)

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: how to write COUNTIFS formula for testing only FILTERED data

    I would add a helper column in C

    In C2 and filled down, put
    =SUBTOTAL(2,B2)

    Then use
    =COUNTIFS(B:B,">15000",C:C,1)

  6. #6
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    fyssas, fotsis and finally i met u FOTIS....
    hey from bodrum.

    can u enter formula with attached file please once more?

  7. #7
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by Jonmo1 View Post
    I would add a helper column in C

    In C2 and filled down, put
    =SUBTOTAL(2,B2)

    Then use
    =COUNTIFS(B:B,">15000",C:C,1)
    i dont like helper column method honestly JONMO1

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Hi from Athens

    You watch football and basketball as well!! Well done!

    Edit: I love helper columns!!
    Attached Files Attached Files
    Last edited by Fotis1991; 02-24-2014 at 10:43 AM. Reason: Edit

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by aaaaa34 View Post
    i dont like helper column method honestly JONMO1
    Why?
    They're NOT the end of the world.
    Excel gives you over 16 thousand columns, might as well use a few.

    Quite often the use of a helper column makes the overall calculation more efficient.

  10. #10
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by Fotis1991 View Post
    Hi from Athens

    You watch football and basketball as well!! Well done!

    Edit: I love helper columns!!
    ahahha super!!!
    nice to meet u FOTIS1991 )
    and thanks to all guys: Tony Valko , ragulduy , Jonmo1 for all answers )

    take care my friends!!!

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    You are welcome and thanks for the feed back.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED,as per Forum Rule #9. Thank you.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

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

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by ragulduy View Post
    =SUM(IF(SUBTOTAL(109,OFFSET(B1,ROW(A1:A22),0,1,1))>15000,1,0))

    as an array formula (confirm with ctrl+shift+enter)
    Now that I think about it, ragulduy's suggestion is the better method but I would write it like this:

    =SUMPRODUCT(--(SUBTOTAL(9,OFFSET(B2,ROW(B2:B23)-ROW(B2),0))>15000))

  13. #13
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by Jonmo1 View Post
    Why?
    They're NOT the end of the world.
    Excel gives you over 16 thousand columns, might as well use a few.

    Quite often the use of a helper column makes the overall calculation more efficient.
    ur point of view more functional, my point of view is totally pragmatism with simple view as much as much possible.
    sorry buddy : )))

  14. #14
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: how to write COUNTIFS formula for testing only FILTERED data

    No need to be sorry.
    It's just a matter of opinion anyway.

    Glad you have resolution one way or another.

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

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by aaaaa34 View Post
    and thanks to all guys: Tony Valko , ragulduy , Jonmo1 for all answers )

    take care my friends!!!
    You're welcome. We appreciate the feedback!

  16. #16
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    good morning my friends,

    can u help me pls about my attached file
    i added one more Column which shows sales for which country

    i wanna count the Sales which is over 15000 only to Greece
    can u help pls?
    Attached Files Attached Files

  17. #17
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Hello neighbor!!

    Try this one.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  18. #18
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    καλημέρα καλημέρα : ))
    thanks a lot my friend : ))
    i hope u re oke : )))
    take care

    only can u add the formula in my xlsx file please? my excel is turkish so its getting problem for to translate it to turkiish : ))
    also it looks like there is error in 3,OFFSET part.
    Attached Files Attached Files
    Last edited by aaaaa34; 03-03-2014 at 07:50 AM.

  19. #19
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Ok. Here you are..!
    Attached Files Attached Files

  20. #20
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    bravo fotis : )))
    u always add values to OUR FRIENDSHIP AND PEACE :pp

  21. #21
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by aaaaa34 View Post
    bravo fotis : )))
    u always add values to OUR FRIENDSHIP AND PEACE :pp
    I wish to do this my friend. Very happy if i can do this!

    Regards!

  22. #22
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Be sure u do this MY BUDDY!!!
    in june i ll support Hellas with u in brasil : )))
    take care
    see ya

  23. #23
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    ya i know
    i really made u bored : )))
    but last last last info i need my friend so sorry

    How can i count total rows appear when i filter only for 2012 ?
    Attached Files Attached Files

  24. #24
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    u didnt see my #23 msg yesterday i think Fotis

  25. #25
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Quote Originally Posted by aaaaa34 View Post
    u didnt see my #23 msg yesterday i think Fotis
    It's true. I didn't see it!

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is your formula.

    In fact is the same formula with slight modifications.

    It would be useful to study a little and to try to work according your needs.

    ..i really made u bored : )))
    but last last last info i need my friend so sorry
    No need to be sorry. It's not a big deal..! The important is to try to learn something from this!

    Have a nice evening!

  26. #26
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Fotis,

    thank u so much for ur answer once more.

    but, u wrote a formula with adding year column filter
    i mean,
    if i used 3-4 filters at the same time, cant we write more general formula for counting how many rows seen in that moment in sheet?

    can u look to my this attached file please?
    and can u add possible solution formula inside the sheet and send me back new one please?

    01112347.xlsx

  27. #27
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: how to write COUNTIFS formula for testing only FILTERED data

    Hello.

    Probably you mean(?)

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  28. #28
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    Re: how to write COUNTIFS formula for testing only FILTERED data

    yup exactly MY NEıGHBOR!!!

    THANK U 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. CountIfs on a Filtered list?
    By Thymoolean in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2013, 08:25 PM
  2. COUNTIFS filtered by month
    By HeathWilD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2012, 05:06 PM
  3. Replies: 18
    Last Post: 07-30-2012, 01:29 AM
  4. Replies: 3
    Last Post: 01-20-2012, 01:20 PM
  5. testing data, insert formula depending on data length
    By davidparkes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-02-2011, 06:22 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