+ Reply to Thread
Results 1 to 4 of 4

Basic array formula question

  1. #1
    Registered User
    Join Date
    04-14-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2007
    Posts
    2

    Basic array formula question

    I would like to write a formula that counts the number of times any one of multiple conditions appear in a column cell.

    I know this notation is incorrect, but what I am trying to do is basically this:

    =countif(a:a "ABC", "DEF", "GHI", "JKL")

    ...to count the number of times either ABC, DEF, GHI, or JKL appear in column A. What am I doing wrong in my notation, and how could I use an array formula to count these conditions?

    Thank you very much, in advance, to anyone who can offer any help with this!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,628

    Re: Basic array formula question

    Hi Norman,

    maybe this would help (normal enter for formula):

    =SUMPRODUCT(COUNTIF(A1:A10, {"ABC", "DEF"}))

    Or this if you have reference instead of ABC....

    =SUMPRODUCT(COUNTIF(A1:A10, C1:C5))

    Note: Even if you can use whole range (As A:A) with SUMPRODUCT formula (or any other array formula) it's better to keep range at minimum point.

  3. #3
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Basic array formula question

    =COUNTIF(A:A,"abc")+COUNTIF(A:A,"DEF")+COUNTIF(A:A,"GHI")
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  4. #4
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Basic array formula question

    This formula can be entered normally:
    Please Login or Register  to view this content.
    Hope that helps,

    Colin

    RAD Excel Blog

+ 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