MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 10th, 2002, 02:16 AM   #1
sholmb1
 
Join Date: Apr 2002
Posts: 5
Default

I need to get a total of all values in column C only if column A equals Department and Column B equal TeamA.

A________________B_______________C
Department______TeamA___________.25
Department______TeamA__________1.0
Division________TeamA__________2.0
Department______TeamB__________3.0
Department______TeamA___________.25

I only want the total to include rows 1,2 and 5. The value would be 1.5

I tried the SUMIF command, but that only includes one column of criteria. (That I know how to do).

Is there an easy way to do this with a formula?

Thanks.

[ This Message was edited by: sholmb1 on 2002-04-09 21:17 ]

[ This Message was edited by: sholmb1 on 2002-04-09 21:17 ]

[ This Message was edited by: sholmb1 on 2002-04-09 21:20 ]
sholmb1 is offline   Reply With Quote
Old Apr 10th, 2002, 02:22 AM   #2
Dave Patton
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 1,761
Default


=SUMPRODUCT((A2:A6="Department")*(B2:B6="TeamA")*(C2:C6))

or use Cell references for Criteria

=SUMPRODUCT((A2:A6=G1)*(B2:B6=G2)*(C2:C6))

Revise references as necessary.

or set up as Database and use DSum.

[ This Message was edited by: Dave Patton on 2002-04-09 21:24 ]
Dave Patton is offline   Reply With Quote
Old Apr 10th, 2002, 02:38 AM   #3
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,448
Default

Hi Sholmb1:
You could use the following formula:

=SUMIF(A2:A6,"=Department",C2:C6)-SUMIF(B2:B6,"=TeamB",C2:C6)

that results in 1.5
__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Apr 10th, 2002, 02:45 AM   #4
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,448
Default

Quote:
On 2002-04-09 21:22, Dave Patton wrote:

=SUMPRODUCT((A2:A6="Department")*(B2:B6="TeamA")*(C2:C6))

or use Cell references for Criteria

=SUMPRODUCT((A2:A6=G1)*(B2:B6=G2)*(C2:C6))

Revise references as necessary.

or set up as Database and use DSum.

[ This Message was edited by: Dave Patton on 2002-04-09 21:24 ]
Hi Dave:
I like this better than what I posted above ... this is more comprehensive in applicability. T H A N K S !

[ This Message was edited by: Yogi Anand on 2002-04-09 21:46 ]
Yogi Anand is offline   Reply With Quote
Old Apr 10th, 2002, 03:42 PM   #5
sholmb1
 
Join Date: Apr 2002
Posts: 5
Default

Thanks Yogi and Dave.

I think the SUMIF forumla misses the point. If the value of 3 is changed in my example to say 34, The answer is not 1.5 The SUMIF solution would work if the values in column C were constant.

I am having some luck with the SUMPRODUCT formula. It works when I enter it on the same worksheet, but I am going between workbooks and getting a #value error when I add in the last columns (C) criteria into the formula (It works with only having column A and B in the sumproduct formula although it returns a total for the number of matches between the two columns (In my example above it would be 3). I don't know how, when I add in column C criteria that it changes to 1.5.)

If you have other suggestions, I am open to anything.

Thanks again for all your help.
sholmb1 is offline   Reply With Quote
Old Apr 10th, 2002, 03:52 PM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 40,647
Default

Quote:
On 2002-04-10 10:42, sholmb1 wrote:
Thanks Yogi and Dave.

I think the SUMIF forumla misses the point. If the value of 3 is changed in my example to say 34, The answer is not 1.5 The SUMIF solution would work if the values in column C were constant.

I am having some luck with the SUMPRODUCT formula. It works when I enter it on the same worksheet, but I am going between workbooks and getting a #value error when I add in the last columns (C) criteria into the formula (It works with only having column A and B in the sumproduct formula although it returns a total for the number of matches between the two columns (In my example above it would be 3). I don't know how, when I add in column C criteria that it changes to 1.5.)

If you have other suggestions, I am open to anything.

Thanks again for all your help.
I couldn't follow what you're saying about the SUMPRODUCT formula.

Changing values in the ranges where SUMPRODUCT looks at will not affect the formula at all.

What do you mean by moving between workbooks? Are you trying to apply the formula say from within WB1 on data in WB2?

Aladin Akyurek is offline   Reply With Quote
Old Apr 12th, 2002, 07:45 PM   #7
sholmb1
 
Join Date: Apr 2002
Posts: 5
Default

I was able to get it to work. My issue was with 1) my formula. With the SUMPRODUCT function, all ranges need to be the same. (SUMPRODUCT(A4:A10)*(B4:B10)*(C4:C10)). 2) non numeric data in numeric fields. I had spaces in my column C that would give back a #value error. Once I cleaned all this up, it works like a charm. Thanks for all your help.
sholmb1 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 11:18 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes