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 May 12th, 2002, 06:59 PM   #1
AmberJo
New Member
 
Join Date: Apr 2002
Location: Uni Credit Union
Posts: 17
Default

What I want to do is a 'sumif function' with 2 criteria-

ie if member is class 2 and decile 1.

Is there a way of linking these two criteria together in this type of function?

[ This Message was edited by: AmberJo on 2002-05-12 22:44 ]
AmberJo is offline   Reply With Quote
Old May 12th, 2002, 07:12 PM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-12 17:59, AmberJo wrote:
What I want to do is a 'sumif function' with 2 criteria-

ie if member is class 2 and decile 1.

Is there a way of linking these two criteria together in this type of function?
No.

You need a SUMPRODUCT, an array, or DSUM formula:

=SUMPRODUCT((Range1=E1)*(Range2=E2),Range3)

where Range1 and Range2 are ranges for which the criteria/conditions in E1 and E2 (such as class and decile values), repectively, must hold. Range3 is the range to be summed.
Aladin Akyurek is offline   Reply With Quote
Old May 12th, 2002, 07:39 PM   #3
Qroozn
Board Regular
 
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
Default

sorry,
I didnt realise what class and decile was referring to!
Qroozn is offline   Reply With Quote
Old May 12th, 2002, 08:14 PM   #4
AmberJo
New Member
 
Join Date: Apr 2002
Location: Uni Credit Union
Posts: 17
Default

I can't get it to work:
Column F is decile, Column B is class, and column K is total savings (the bit I want summed).

I want the total savings of members who are in decile 1 AND class 2. This is what I've got so far :

=SUMPRODUCT('[May 2 02 without formulas.xls]Sheet1'!$F:$F=1)*('[May 2 02 without formulas.xls]Sheet1'!$B:$B=2), ('[May 2 02 without formulas.xls]Sheet1'!K:K)

Am I on the right track?
AmberJo is offline   Reply With Quote
Old May 12th, 2002, 08:17 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-12 19:14, AmberJo wrote:
I can't get it to work:
Column F is decile, Column B is class, and column K is total savings (the bit I want summed).

I want the total savings of members who are in decile 1 AND class 2. This is what I've got so far :

=SUMPRODUCT('[May 2 02 without formulas.xls]Sheet1'!$F:$F=1)*('[May 2 02 without formulas.xls]Sheet1'!$B:$B=2), ('[May 2 02 without formulas.xls]Sheet1'!K:K)

Am I on the right track?
Yes. Just substitute real, definite ranges for $F:$F, $B:$B, and $K:$K. Such column args are not accepted in SUMPRODUCT or array-formulas.
Aladin Akyurek is offline   Reply With Quote
Old May 12th, 2002, 08:28 PM   #6
AmberJo
New Member
 
Join Date: Apr 2002
Location: Uni Credit Union
Posts: 17
Default

XL still doesn't like it. It suggests I put a * instead of a comma before the last bit (ie =SUMPRODUCT('[May 2 02 without formulas.xls]Sheet1'!F1:F13000=1)*('[May 2 02 without formulas.xls]Sheet1'!B1:B13000=2)*('[May 2 02 without formulas.xls]Sheet1'!K1:K13000)

When I do this it comes up with an #N/A thingy. Any ideas?

AmberJo is offline   Reply With Quote
Old May 12th, 2002, 08:30 PM   #7
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-12 19:28, AmberJo wrote:
XL still doesn't like it. It suggests I put a * instead of a comma before the last bit (ie =SUMPRODUCT('[May 2 02 without formulas.xls]Sheet1'!F1:F13000=1)*('[May 2 02 without formulas.xls]Sheet1'!B1:B13000=2)*('[May 2 02 without formulas.xls]Sheet1'!K1:K13000)


When I do this it comes up with an #N/A thingy. Any ideas?

=SUMPRODUCT(('[May 2 02 without formulas.xls]Sheet1'!F1:F13000=1)*('[May 2 02 without formulas.xls]Sheet1'!B1:B13000=2),('[May 2 02 without formulas.xls]Sheet1'!K1:K13000))

should be Ok.

BTW: a "*" as well as a "," will both work between the last 2 arguments.


[ This Message was edited by: Aladin Akyurek on 2002-05-12 19:30 ]

[ This Message was edited by: Aladin Akyurek on 2002-05-12 19:32 ]
Aladin Akyurek is offline   Reply With Quote
Old May 12th, 2002, 08:36 PM   #8
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
Default

Quote:
On 2002-05-12 19:28, AmberJo wrote:
XL still doesn't like it. It suggests I put a * instead of a comma before the last bit (ie =SUMPRODUCT('[May 2 02 without formulas.xls]Sheet1'!F1:F13000=1)*('[May 2 02 without formulas.xls]Sheet1'!B1:B13000=2)*('[May 2 02 without formulas.xls]Sheet1'!K1:K13000)

When I do this it comes up with an #N/A thingy. Any ideas?
Hi AmberJo:
The problem might be with syntax (the organization of the formula), and not with the logic of the formula that Aladin gave you.
Look at you formula carefully, and see if you have supplied everything correctly as Aladin suggested. You may also post the actual formula that is giving you the #N/A -- please also post the values of the cells in your formula.

Regards!
__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old May 12th, 2002, 08:58 PM   #9
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

See the figure, in which I also added the use of DSUM. Since you have a big range, the latter might suit you better.

Microsoft Excel - May 2 02 without formulas.xls_______________Running: xl2000 : OS = Windows (32-bit) NT 5.00
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
B1=labelB
*BCDEFGHIJKLMNOP
1labelB***labelF****labelK***labelBlabelF
21***2****40***12
32***1****20*****
41***4****30*:alert('=SUMPRODUCT(($B$2:$B$6=1)*($F$2:$F$6=2),($K$2:$K$6))')>90*:alert('=DSUM(B1:K6,"labelK",O1:P2)')>90*
53***2****25*****
61***2****50*****
Sheet1

To see the formula in the cells just click on the cells hyperlink

The above image was automatically generated by [HtmlMaker V1.20]
If you want this code, click here and Colo will email the file to you.
This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo




[ This Message was edited by: Aladin Akyurek on 2002-05-12 19:59 ]
Aladin Akyurek 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 -4. The time now is 04:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 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