+ Reply to Thread
Results 1 to 8 of 8

How to Countif statements with corresponding columns

  1. #1
    Forum Contributor
    Join Date
    03-20-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    108

    How to Countif statements with corresponding columns

    I have two columns (column A has colors and column B has sizes).

    I need to count all the cells in column B that are a size "medium" and if the colour is "red" in column A.

    What is a simple formula to calculate that.

    Thank you

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: How to Countif statements with corresponding columns

    If you are using 2003 (as your profile says), try this....
    =sumproduct((B2:B10="medium")*(A2:A10="red"))

    If you have 2007 or later...
    =countifs(B2:B10,"medium",A2:A10,"red")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: How to Countif statements with corresponding columns

    You could use something like this
    =sumproduct((Col A = "red")*(Col B = "medium"))
    Replace Col A and Col B with the actual data ranges involved
    Both ranges should be same height
    -----------------------
    Any good? Wave it, whack the little star at the bottom left of my responses

  4. #4
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: How to Countif statements with corresponding columns

    simply use countifs function as below

    count ifs ( criteria range1 , criteria 1, criteria range2 , criteria 2)

    pls note pls freeze criteria range

    as select the range and press f4 key....

    else the result would be effected if you drag ur formula down


    many thanks
    Rishi Saw

  5. #5
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: How to Countif statements with corresponding columns

    simply use countifs function as below

    count ifs ( criteria range1 , criteria 1, criteria range2 , criteria 2)

    pls note pls freeze criteria range

    as select the range and press f4 key....

    else the result would be effected if you drag ur formula down


    many thanks
    Rishi Saw

  6. #6
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: How to Countif statements with corresponding columns

    OP's version is Excel 2003 - COUNTIFS don't exist

  7. #7
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: How to Countif statements with corresponding columns

    so in that case we only sumproduct is only one way to solve the problem....

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

    Re: How to Countif statements with corresponding columns

    Quote Originally Posted by rishikrsaw View Post
    so in that case we only sumproduct is only one way to solve the problem....
    Yes, and both solutions were proposed in post #2 by FDibbins. So, your posts are not really useful, are they, except for making things confusing for the OP?

+ 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] IF and COUNTIF statements
    By rowena229 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-22-2013, 03:08 PM
  2. Help with COUNTIF Statements
    By vanurdi010310 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-15-2013, 02:51 PM
  3. COUNTIF Statements
    By macka1987 in forum Excel General
    Replies: 3
    Last Post: 06-05-2011, 04:40 PM
  4. COUNTIF statements
    By italiavb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2006, 08:40 PM
  5. Countif Statements
    By alymcmorland in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2005, 09:05 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