+ Reply to Thread
Results 1 to 8 of 8

Use COUNTIF on SubTotal data

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    Cork
    MS-Off Ver
    2019
    Posts
    78

    Use COUNTIF on SubTotal data

    On the attached worksheet I have applied a Subtotal to my data. In a separate column I now want to do a count of each group of stock qty data that contains zero. I have used the COUNTIF Function in C10, but want to do the same in the total for each group. This is only a small amount of data, but in my original there are a large amount of products. Thank in advance for your help.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Use COUNTIF on SubTotal data

    is it OK for me to put the subtotal in another column? Then it becomes very easy.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    05-18-2016
    Location
    Cork
    MS-Off Ver
    2019
    Posts
    78

    Re: Use COUNTIF on SubTotal data

    Yes, absolutely

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Use COUNTIF on SubTotal data

    Ok.

    C2:
    =if(countif($a$2:a2,a2)=countif(a:a,a2),countif(a:a,a2),"")

    d2:
    =if(countif($a$2:a2,a2)=countif(a:a,a2),countifs(a:a,a2,b:b,0),"")
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-18-2016
    Location
    Cork
    MS-Off Ver
    2019
    Posts
    78

    Re: Use COUNTIF on SubTotal data

    Glenn, that is great, thank you. I'll just test it now on my original data.

  6. #6
    Registered User
    Join Date
    05-18-2016
    Location
    Cork
    MS-Off Ver
    2019
    Posts
    78

    Re: Use COUNTIF on SubTotal data

    Glenn, can you explain what you did to get to sub-total in COLUMN c?

  7. #7
    Registered User
    Join Date
    05-18-2016
    Location
    Cork
    MS-Off Ver
    2019
    Posts
    78

    Re: Use COUNTIF on SubTotal data

    Sorry Glenn, just noticed there was no need for the sub-total, you have used the CountIF.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Use COUNTIF on SubTotal data

    Sure.

    =if(countif($a$2:a2,a2)=countif(a:a,a2),countif(a:a,a2),"")

    Red: if the incremental count of A2 (and it will be at the last (nth) occurrence of the value in A2 as youc copy down the table)
    Orange: is equal to the total count in column A of the value in A2
    Cyan: retutn the total count of the value in column A of the value in An... the last occurrence of that value.
    Black otherwise retun a blank.

    See columns G & H.

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
    Attached Files Attached Files

+ 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] CountIf for Each SubTotal
    By punster in forum Excel General
    Replies: 10
    Last Post: 12-01-2020, 01:00 PM
  2. [SOLVED] How to use countif with subtotal
    By lewini in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-28-2020, 12:07 PM
  3. Sorting by Alpha, Adding Subtotal - then removing subtotal - variable data sets
    By gregg_grug in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2019, 07:41 PM
  4. [SOLVED] Subtotal countif
    By Median in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-20-2018, 08:37 PM
  5. [SOLVED] How to do COUNTIF with SUBTOTAL
    By ZOZOZIAD in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 03-29-2018, 04:20 AM
  6. How to do COUNTIF with SUBTOTAL
    By ZOZOZIAD in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-28-2018, 09:02 AM
  7. [SOLVED] =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]
    By thomas.mapua in forum Excel General
    Replies: 5
    Last Post: 01-06-2012, 11:33 AM

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