+ Reply to Thread
Results 1 to 20 of 20

Count Function Help

  1. #1
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Count Function Help

    Thank you in advance for any assistance you can provide:

    Excel example.JPG

    I am trying to count the number of clients (Row 22) accrued each month. I have tried various Count, Sum, Offset and Logic rules but cannot get this to work.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,502

    Re: Count Function Help

    you don't say what you've tried so far.
    how about =COUNTIF(C2:C19,"<>") dragged right.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Count Function Help

    Quote Originally Posted by Sambo kid View Post
    you don't say what you've tried so far.
    how about =COUNTIF(C2:C20,"<>") dragged right.
    Just tiny fix.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Thanks Sambo Kid.

    Problem with that formula is it only counts the active clients in that month. If we assume a client becomes live the first month they sell units, any units they sell in a later month shouldn't be counted.

    Sorry if I'm not explaining as well as poss!

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Count Function Help

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    FYI I have hard entered the count value that the formula needs to generate in Row 22

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Count Function Help

    Did I understand correctly? Ex. Client10 (in row 11) have to be counted only in D22 as 'his' debut and should not be taken into account on Apr and May, right?

  8. #8
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Quote Originally Posted by Pepe Le Mokko View Post
    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
    Remember to desensitize the data.
    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Hi Pepe - attached as requested

    Thank you
    Attached Files Attached Files
    Last edited by bowlerjp; 02-09-2019 at 07:06 AM.

  9. #9
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Quote Originally Posted by KOKOSEK View Post
    Did I understand correctly? Ex. Client10 (in row 11) have to be counted only in D22 as 'his' debut and should not be taken into account on Apr and May, right?
    Correct as once they have made unit sales I want to qualify them as an active client. Therefore they are counted only once in February '19.

    Thank you

  10. #10
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Count Function Help

    So attached file is wrong imho, should be

    Capture.JPG

    3 7(4 new) 7(0)new 8(1 new) etc.
    Last edited by KOKOSEK; 02-09-2019 at 09:19 AM.

  11. #11
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Quote Originally Posted by KOKOSEK View Post
    So attached file is wrong imho, should be

    Attachment 610567

    3 7(4 new) 7(0)new 8(1 new) etc.
    I may be wrong but when I manually total them I get Client 12 becoming active in July'19 and therefore it goes 10,11,12,12,13?

  12. #12
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,923

    Re: Count Function Help

    Try this in B22:

    =SUMPRODUCT(--(SUMIF(OFFSET($B$2:B$2,ROW($B$2:$B$20)-ROWS($B$1:$B$2),),">0")>0))

  13. #13
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Count Function Help

    IMHO works perfect.

  14. #14
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Quote Originally Posted by phuocam View Post
    try this in b22:

    =sumproduct(--(sumif(offset($b$2:b$2,row($b$2:$b$20)-rows($b$1:$b$2),),">0")>0))
    thank you so much!

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,420

    Re: Count Function Help

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

    Please make your thread titles more descriptive in future. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  16. #16
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Quote Originally Posted by Phuocam View Post
    Try this in B22:

    =SUMPRODUCT(--(SUMIF(OFFSET($B$2:B$2,ROW($B$2:$B$20)-ROWS($B$1:$B$2),),">0")>0))
    Apologies if I am missing something obvious however when I apply this to a greater set of rows I can't get it to work. I've attached the the actual anonymous version for ease. The row the count needs to go in is at 119.

    Thank you again
    Attached Files Attached Files

  17. #17
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Count Function Help

    Please try at J119

    =SUMPRODUCT(N(MMULT(N($J31:J117>0),ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0)>0))

  18. #18
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Quote Originally Posted by Bo_Ry View Post
    Please try at J119

    =SUMPRODUCT(N(MMULT(N($J31:J117>0),ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0)>0))
    Excellent it works thank you.

    Could you please explain the formula so I understand for future reference?

  19. #19
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Count Function Help

    First, you need to understand MMULT, which quite hard to explain.

    Please read this
    https://www.engineerexcel.com/matrix...tion-in-excel/


    Small change
    J119
    =SUMPRODUCT(N(MMULT($J31:J117,ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0)>0))


    J119
    $J31:J117 return matrix of 87 Rows and 1 Column
    ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0 give {1} 1 row 1 column
    MMULT(N($J31:J117>0),ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0) give result of sum of each 87 rows

    For MMULT Column# of the 1st array need to match row# of 2nd Array as in blue

    K119
    $J31:K117 return matrix of 87 Rows and 2 Columns
    ROW(INDIRECT("1:"&COLUMNS($J31:K117)))^0 give {1;1} 2 rows 1 column
    MMULT(N($J31:J117>0),ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0) give result of sum of each 87 rows and 2 columns, and so on for the next column.


    =SUMPRODUCT(N(MMULT($J31:J117,ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0)>0))
    Green part for chech each row if sum are more than 1 and Sumproduct to count that.



    You may change Phuocam's formula to below.

    Sumif(offset()) result is similar to MMULT()

    =SUMPRODUCT(N(SUMIF(OFFSET($J31:J31,ROW(J31:J117)-ROW(J31),),">0")>0))

    or

    =SUMPRODUCT(N(SUBTOTAL(9,OFFSET($J31:J31,ROW(J31:J117)-ROW(J31),))>0))
    Last edited by Bo_Ry; 02-09-2019 at 12:46 PM.

  20. #20
    Registered User
    Join Date
    02-09-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    15

    Re: Count Function Help

    Quote Originally Posted by Bo_Ry View Post
    First, you need to understand MMULT, which quite hard to explain.

    Please read this

    Small change
    J119
    =SUMPRODUCT(N(MMULT($J31:J117,ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0)>0))


    J119
    $J31:J117 return matrix of 87 Rows and 1 Column
    ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0 give {1} 1 row 1 column
    MMULT(N($J31:J117>0),ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0) give result of sum of each 87 rows

    For MMULT Column# of the 1st array need to match row# of 2nd Array as in blue

    K119
    $J31:K117 return matrix of 87 Rows and 2 Columns
    ROW(INDIRECT("1:"&COLUMNS($J31:K117)))^0 give {1;1} 2 rows 1 column
    MMULT(N($J31:J117>0),ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0) give result of sum of each 87 rows and 2 columns, and so on for the next column.


    =SUMPRODUCT(N(MMULT($J31:J117,ROW(INDIRECT("1:"&COLUMNS($J31:J117)))^0)>0))
    Green part for chech each row if sum are more than 1 and Sumproduct to count that.



    You may change Phuocam's formula to below.

    Sumif(offset()) result is similar to MMULT()

    =SUMPRODUCT(N(SUMIF(OFFSET($J31:J31,ROW(J31:J117)-ROW(J31),),">0")>0))

    or

    =SUMPRODUCT(N(SUBTOTAL(9,OFFSET($J31:J31,ROW(J31:J117)-ROW(J31),))>0))
    Thank you, really appreciate your help and tuition!

+ 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. function to count the average, check if not empty, then count
    By doudou in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-06-2019, 06:55 AM
  2. Replies: 17
    Last Post: 04-11-2016, 11:14 PM
  3. User defined function- count color and count only visible rows
    By marsjanik1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2016, 03:05 PM
  4. [SOLVED] COUNT function does not count values beginning with text
    By PeteABC123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2013, 06:38 PM
  5. [SOLVED] Count If Function To Count Frequency Of Long Numbers
    By RowanB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2013, 05:18 AM
  6. Using the COUNT function to count letters generated by an IF function
    By SMErickson7 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-28-2013, 12:02 PM
  7. Replies: 2
    Last Post: 06-23-2009, 11:16 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