+ Reply to Thread
Results 1 to 8 of 8

Counting two criterias

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    19

    Counting two criterias

    So I wanna count the number of cells in A:A that are "A", so like countif(A:A,"A"), then count the number of cells in B:B that are "<1000", so like countif(B:B, "<1000"). How do I combine them both? I am using excel 2003, so I can't use countifs.
    I tried using this formula: =SUM(--(A:A="A")*(B:B="<1000")), but it is not working. Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,347

    Re: Counting two criterias

    Try:

    =SUMPRODUCT(--($A$2:$A$1000="A"),--($B$2:$B$1000<1000))


    Note that you must define ranges, and the size of the ranges must be the same. SUMPRODUCT in Excel 2003 will not accept a full column.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Counting two criterias

    Pl use this array formula.

    {=SUMPRODUCT(--(A:A="A"),--(B:B<1000))}

  4. #4
    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: Counting two criterias

    Hi jleung07 and welcome to the Forum.

    1st Formula for this. >>>> =SUM((A1:A10="A")*(B1:B10<=1000))>>Array formula(CSE), so i think is better to use this formula.

    =SUMPRODUCT((A1:A10="A")*(B1:B10<=1000))

    Hope to helps you.
    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.

  5. #5
    Registered User
    Join Date
    01-12-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Counting two criterias

    Thanks guys

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,347

    Re: Counting two criterias

    Note that SUMPRODUCT is already an Array formula and does NOT need to be Array Entered with Ctrl-Shift-Enter.

    And, as previously stated, SUMPRODUCT in Excel 2003 must have a range not a column.


    Regards, TMS

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,347

    Re: Counting two criterias

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Counting two criterias

    Dear TMshucks,

    Thanks for the information.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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