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 23rd, 2002, 04:37 PM   #1
lars
Board Regular
 
Join Date: Mar 2002
Location: California
Posts: 105
Default

Here is my formula
=SUMPRODUCT(('327'!B6:B424=Summary!A10)*(IF(SUM('327'!R6:R424)>SUM('327'!S6:S424),'327'!R6:R424,'327'!S6:S424)))


The formula looks at a voyage (summary!A10)
and finds that in the B6:B424 range and then goes over in the table and looks at two sets of numbers one in the range R6:R424 and another in range S6:S424 whichever one is greater should come back. but for some reason it gives me the smaller of the two.

Any suggestions?

Thanks

lars is offline   Reply With Quote
Old May 23rd, 2002, 05:40 PM   #2
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

Quote:
On 2002-05-23 15:37, lars wrote:
Here is my formula
=SUMPRODUCT(('327'!B6:B424=Summary!A10)*(IF(SUM('327'!R6:R424)>SUM('327'!S6:S424),'327'!R6:R424,'327'!S6:S424)))


The formula looks at a voyage (summary!A10)
and finds that in the B6:B424 range and then goes over in the table and looks at two sets of numbers one in the range R6:R424 and another in range S6:S424 whichever one is greater should come back. but for some reason it gives me the smaller of the two.

Any suggestions?

Thanks

I've tries to replicate your error and not found any problems, the following is a SIMPLE set-up to what I believe you have:

Microsoft Excel - 12.xls___Running: xl2002 XP : OS = Windows (32-bit) 4.10
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
E1=m

A
B
C
D
E
1
m12
m
2
912

3
912

4
912
:alert('=SUMPRODUCT((A1:A20=E1)*(IF(SUM(B1:B20)%3ESUM(C1:C20),B1:B20,C1:C20)))')>14
5
912

6
m12

7
912

8
912

9
912

10
912

11
m12

12
912

13
912

14
912

15
912

16
912

17
m12

18
m12

19
m12

20
m12

Sheet1

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

The above image was automatically generated by [HtmlMaker V1.27]
If you want FREE SOFT, 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


Can you extend on what the fields contain that your looking at?
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old May 23rd, 2002, 05:55 PM   #3
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default



Do you want the Max of the 2 Totals or the Max of the sum that meets the criteria in A10?

Your formula should give the maximum Total.

For Max of numbers that meet criteria, consider

=MAX(SUMPRODUCT(('327'!B6:B10=A10)*('327'!R6:R10)),SUMPRODUCT(('327'!B6:B10=A10)*('327'!S6:S10)))

Edit the ranges to fit your information.
Dave Patton is offline   Reply With Quote
Old May 23rd, 2002, 11:44 PM   #4
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-23 15:37, lars wrote:
Here is my formula
=SUMPRODUCT(('327'!B6:B424=Summary!A10)*(IF(SUM('327'!R6:R424)>SUM('327'!S6:S424),'327'!R6:R424,'327'!S6:S424)))


The formula looks at a voyage (summary!A10)
and finds that in the B6:B424 range and then goes over in the table and looks at two sets of numbers one in the range R6:R424 and another in range S6:S424 whichever one is greater should come back. but for some reason it gives me the smaller of the two.

Any suggestions?

Thanks
Maybe you're looking for:

=SUMPRODUCT(('327'!B6:B424=Summary!A10)*(MAX('327'!R6:R424,'327'!S6:S424)))

Aladin Akyurek is offline   Reply With Quote
Old May 24th, 2002, 10:34 AM   #5
lars
Board Regular
 
Join Date: Mar 2002
Location: California
Posts: 105
Default

Thanks Dave and Aladin, I used Daves because Aladins gave me the total of both columns and Daves gave me the greater of the two which is what I needed.

Thanks guys
lars is offline   Reply With Quote
Old May 24th, 2002, 11:35 AM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-24 09:34, lars wrote:
Thanks Dave and Aladin, I used Daves because Aladins gave me the total of both columns and Daves gave me the greater of the two which is what I needed.

Thanks guys
Lars,

In that case, I'd strongly suggest (I reckon Dave also would agree)switching to SUMIF:

=MAX(SUMIF('327'!B6:B10,A10,'327'!R6:R10),SUMIF('327'!B6:B10,A10,'327'!S6:S10))

Aladin
Aladin Akyurek is offline   Reply With Quote
Old May 24th, 2002, 03:42 PM   #7
lars
Board Regular
 
Join Date: Mar 2002
Location: California
Posts: 105
Default

Aladin, i like the suggestion it is easier to work with.

Thanks
lars 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:00 AM.


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