+ Reply to Thread
Results 1 to 4 of 4

Countif but not quite

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    Stafford
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question Countif but not quite

    Help,

    I need a way to:

    a) count the number of Sausage Sarnies with brown sauce
    b) the total cost of the sausage sarnies with brown sauce.

    A..............B....................C...................D
    Sausage...White Bread.....Red Sauce.....2.50
    Bacon.......Brown Bread...Red Sauce.....2.00
    Bacon.......White.............Brown...........2.00
    Bacon.......Brown............Brown...........2.00
    Sausage...White..............Red...............2.50
    Sausage...White..............Brown...........2.50


    I thought I nearly had using Countif but couldn't figure out the sauce bit

    Thanks for any help


    Paul
    Last edited by Paul_tg; 10-06-2009 at 10:05 AM. Reason: Somebody Much Clever than me has solved my problem

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Countif but not quite

    For multiple criteria, use Sumproduct()

    e.g. =Sumproduct(--(A1:A10=X1),--(B1:B10=Y1)) to count

    and =Sumproduct(--(A1:A10=X1),--(B1:B10=Y1),C1:C10) to sum

    where A1:B10 contain lookup data separate columns... C1:C10 the summing data

    X1, Y1, the criteria to look for.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Countif but not quite

    Try these:

    =SUMPRODUCT((A1:A6="Sausage")*(C1:C6="Brown Sauce"))
    =SUMPRODUCT((A1:A6="Sausage")*(C1:C6="Brown Sauce")*(D1:D6))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Countif but not quite

    Or if you're conducting multiple / similar calcs use a Pivot Table
    (general intro. link in sig.)

+ 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