+ Reply to Thread
Results 1 to 5 of 5

How to count values in a range with criteria?

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    USA
    MS-Off Ver
    Office365
    Posts
    32

    How to count values in a range with criteria?

    Dear friends,
    I have a question on counting a value with the following example.
    example.JPG

    as shown in the example, i tried to count "good" with "banana" as criteria but it returns error. especially something is wrong in defining range as B2:K4, if i do B2:B4 it works.....I am confused!

    Please suggest

    many thanks
    Prad

  2. #2
    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: How to count values in a range with criteria?

    Try

    =SUMPRODUCT((A2:A4="banana")*(B2:K4="good"))
    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.

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    USA
    MS-Off Ver
    Office365
    Posts
    32

    Re: How to count values in a range with criteria?

    Thanks Fotis - I have another concern - what if there is either or criteria - lets say =SUMPRODUCT((A2:A4="banana")*(B2:K4="good"))
    in B2:K4 = either "good" or "not bad"; how to include this criteria in the formula?

    sorry if i asked you something stupid !

    Prad

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

    Re: How to count values in a range with criteria?

    Quote Originally Posted by Fotis1991 View Post
    Try

    =SUMPRODUCT((A2:A4="banana")*(B2:K4="good"))
    Better still

    =SUMPRODUCT((A2:A4="ouzo")*(B2:K4="very good"))

  5. #5
    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: How to count values in a range with criteria?

    Try this.

    =SUMPRODUCT((A2:A4="banana")*(B2:K4="good"))+SUMPRODUCT((A2:A4="banana")*(B2:K4="not bad"))


    @ pepe

    Better use this one.

    =SUMPRODUCT((A2:A4="ouzo")*(B2:K4="very good"))+SUMPRODUCT((A2:A4="raki")*(B2:K4="excellent"))

+ 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. Count a single range using additional criteria from another range
    By FatFoot in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-27-2013, 08:40 PM
  2. [SOLVED] Would like to count cell values based on date criteria in a different range
    By sdavison in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-23-2013, 12:45 AM
  3. Replies: 6
    Last Post: 11-11-2012, 12:40 AM
  4. Count unique text values in range with criteria
    By cdiaz in forum Excel General
    Replies: 3
    Last Post: 07-15-2011, 10:43 AM
  5. Count multiple values in cell with range criteria
    By leanne13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-06-2009, 02:26 PM

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