We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel formula help!

Options
2»

Comments

  • Doozergirl wrote: »
    Essentially, I'm trying to add up all the commission made by people with a certain job title(bread) in a certain area(butter).

    It is SUMIF, but you don't need the AND

    What you're asking is "gimme the sum of those cells in column H which have "bread" in column G"

    Tom has the right answer here

    SUMIF(A1 : A10,"bread",B1:B10)


    Which needs to be edited to
    =SUMIF('Sheet2'!G2:G90,"bread",H2:H90)

    The "AND" is implicit in the SUMIF function - as it only sums those in column H if there is (also) "Bread" in column G.
    Warning ..... I'm a peri-menopausal axe-wielding maniac ;)
  • Doozergirl
    Doozergirl Posts: 34,075 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Okay, I've got it! I did try to explain it but didn't do it properly, sorry. I did try :o

    I needed the sum of a completely different column which is full of the commission where someone with the job title of 'bread' working in an area called 'butter' sold something.

    Apparantly there's something called a conditional sum wizard which I don't seem to have, but I've managed it (I think, well I have a proper number in the cell now|!) with an array formula, of which I know nothing!

    It's along the lines of this, so you're right, there's no AND :confused:

    http://www.ozgrid.com/Excel/arrays.htm

    To get the total cost of male Spaniels sold:
    =SUM(IF($A$2:$A$200="Male",IF($B$2:$B$200="Spaniel",$E$2:$E$200,0),0))


    It was much easier than this writing SQL queries, I'm sure. It was a while ago :confused: I'd like to get another condition in there, but maybe I'm pushing my luck!

    Thanks, guys. Sorry for being rubbish. I'm going to add it up by hand and see if it works!
    Everything that is supposed to be in heaven is already here on earth.
  • tomstickland
    tomstickland Posts: 19,538 Forumite
    10,000 Posts Combo Breaker
    This works !:
    }=SUM(IF((A1 : A10="bread")*(B10:B10="butter"),C1:C10)) }

    This also works
    }=SUM((A1 : A10="bread")*(B1:B10="butter")*(C1:C10)) }
    The MSE forum won't show the open bracket properly, so I've put a closed bracket at the start.

    You have to do Ctrl-Shift-Enter or put the swirly brackets in to make it an array formula.

    So if the column A value is "bread" and the column B value is "butter" then the logical multiplication comes out as true and it includes the element in column C.

    I've tested it and it does what it should.
    Happy chappy
  • Doozergirl
    Doozergirl Posts: 34,075 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    :wall: :wall: :wall:


    Going to try yours Tom, mine isn't quite right!
    Everything that is supposed to be in heaven is already here on earth.
  • Doozergirl
    Doozergirl Posts: 34,075 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    LOL!

    Okay, yours works! In fact, mine works but somebody covered for someone else's patch and the name was out of place :o

    The thank you button has disappeared, but thank you!!!
    Everything that is supposed to be in heaven is already here on earth.
  • If you don't fancy the array formula that Tom gave you could also use

    =SUMPRODUCT(--(A1:A10="bread"),--(B1:B10="butter"),C1:C10)

    Sumproduct is more useful when there is more than one condition to satisfy

    Hope it helps
  • That should be A1(colon)A10
  • GordonD wrote: »
    If you don't fancy the array formula that Tom gave you could also use

    =SUMPRODUCT(--(A1:A10="bread"),--(B1:B10="butter"),C1:C10)

    Although my experiences with Excel tend to lead to little demons rather than little angels :rotfl: :rotfl:

    Yes, I know .... the bloomin post editor converted what you typed! And has me thinking of little demons again! :rotfl:
    Warning ..... I'm a peri-menopausal axe-wielding maniac ;)
  • Doozergirl
    Doozergirl Posts: 34,075 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    I'm emotionally exhausted!
    Everything that is supposed to be in heaven is already here on earth.
  • tomstickland
    tomstickland Posts: 19,538 Forumite
    10,000 Posts Combo Breaker
    Don't forget your colon.
    Happy chappy
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 350.9K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.5K Spending & Discounts
  • 243.9K Work, Benefits & Business
  • 598.7K Mortgages, Homes & Bills
  • 176.9K Life & Family
  • 257.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.