+ Reply to Thread
Results 1 to 2 of 2

"COUNTIF" and "AND" use?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-01-2009
    Location
    Bristow, VA, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question "COUNTIF" and "AND" use?

    I would like to use the COUNTIF command in conjunction with the AND command so that I can have Excel Count if column a is one value and columb is another value.

    .....A.............B...
    1..Red..........Box
    2..Green.......Hat
    3..Blue.........Box
    4..Blue.........Hat
    5..Black........Box
    6..Red..........Hat
    7..Red..........Box

    Normally one would use COUNTIF to count the number of times RED appears in column A or the number of times BOX appears in column B, is what I need to do is count the number of times Red is in column A and Box is in the adjcent cell in column B.

    I have tried these, but they dont work, I must be overlooking something obvious:
    =AND(COUNTIF(A1:A7,"Red"),COUNTIF(B1:B7,"Box"))
    =COUNTIF(A1:A7,"Red")+COUNTIF(B1:B7,"Box")
    =COUNTA(A1:A7="Red",B1:B7="Box")
    Last edited by Tavecosh; 05-01-2009 at 01:50 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080

    Re: "COUNTIF" and "AND" use?

    Try this

    =SUMPRODUCT(--(A1:A7="Red"),--(B1:B7,"Box"))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

+ 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