+ Reply to Thread
Results 1 to 11 of 11

having difficulties in Countif

  1. #1
    Registered User
    Join Date
    04-27-2010
    Location
    google
    MS-Off Ver
    Excel 2003
    Posts
    17

    having difficulties in Countif

    Hi,

    I am trying to use Countif just as Sumif buit it doesn't help.

    I want to count the number of times each of the names appear as in my attached spreadsheet example.

    Please any help would be apprecaited. I have attached a spreadsheet to explain my self better.

    Many thanks

    OCountif and Sumif.xls

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: having difficulties in Countif

    =COUNTIF($B$5:$B$16,B21)

    or maybe

    =SUMPRODUCT(--($D$5:$D$16>0),--($B$5:$B$16=B21))

  3. #3
    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,499

    Re: having difficulties in Countif

    It looks to me like you want =SUMIF($B$5:$B$16,B21,$C$5:$C$16), and =COUNTIF(B5:B16,B21) to get the sum of "Baby" and the count of "Baby".

    EDIT: BTW, this would give you both the count and sum in the same cell...
    =COUNTIF($B$5:$B$16,B21)&" - "&SUMIF($B$5:$B$16,B21,$C$5:$C$16)
    Last edited by Sam Capricci; 12-16-2013 at 08:26 AM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    04-27-2010
    Location
    google
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: having difficulties in Countif

    Hi

    Thanks for your responce, but this has not worked for me.

    I want to be able to count the number of e.g Baby, Factory above for Each month (Jan to Dec).
    I can sum, but not able to count by each of the months which is what i want to do

    Hope this help. Pls see attached spreadsheet.
    O

  5. #5
    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,499

    Re: having difficulties in Countif

    so if i understand it correctly, you have Baby listed three times and there are 12 months so the total should be 36 (3x12) right? Is that the formula you need? (and i'm not trying to minimize it because you just gave a sample of your data.)
    And if this is correct, is it in a list that can be longer than 12 months? Or put differently, would a formula that counts the # of times Baby is found in col B then simply multiplies that value by 12 not work?

    EDIT: if above it true wouldn't this work?
    =COUNTIF($B$5:$B$16,B21)*12
    Last edited by Sam Capricci; 12-16-2013 at 09:38 AM.

  6. #6
    Registered User
    Join Date
    04-27-2010
    Location
    google
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: having difficulties in Countif

    Thanks for your responce, but I need a formula that counts the # of times Baby is found in each of col C-N i.e Jan to Dec.

    Pls kindly assume that listing on Col "B" is about 1000 line items and I need to how many times each month they were paid.

    Hope this clarifies. Many Thanks for your help

    O

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: having difficulties in Countif

    fill in that sheet with the answers you expect
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Registered User
    Join Date
    04-27-2010
    Location
    google
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: having difficulties in Countif

    Hi All,

    I have filled in the sheet with answer i expect to see.

    Hope this help. many thanks

    O
    Attached Files Attached Files

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: having difficulties in Countif

    in c29 filled across and down
    =SUMPRODUCT(($B$7:$B$23=$B29)*(C$7:C$23<>""))
    Attached Files Attached Files
    Last edited by martindwilson; 12-16-2013 at 10:57 AM.

  10. #10
    Registered User
    Join Date
    04-27-2010
    Location
    google
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: having difficulties in Countif

    Excellent martin Wilson, This has worked. You are wonderful. Thank to you

    Many thank to Sambo Kid and BrokenBuiscuits too.

    Thank you all

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: having difficulties in Countif

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

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ 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] Difficulties with COUNTIF.
    By bj in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 09-06-2005, 10:05 AM
  2. Difficulties with COUNTIF.
    By bj in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 04:05 AM
  3. Difficulties with COUNTIF.
    By Martin M in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  4. Difficulties with COUNTIF.
    By Martin M in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  5. [SOLVED] Difficulties with COUNTIF.
    By Martin M in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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