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 Mar 13th, 2002, 08:02 AM   #1
DStan
New Member
 
Join Date: Mar 2002
Posts: 6
Default

I use this array formula to filter and sum:
{=SUM(IF('BWP EXPENSE'!$A$2:$A$50000=10,IF('BWP EXPENSE'!$B$2:$B$50000>=740,IF('BWP EXPENSE'!$B$2:$B$50000<=749,IF('BWP EXPENSE'!$E$2:$E$50000=1999,IF('BWP EXPENSE'!$F$2:$F$50000<=7,'BWP EXPENSE'!$G$2:$G$50000,0),0),0))))}
My question is: IF('BWP EXPENSE'!$F$2:$F$50000<=7 where 7 = period or in our case January. I would like to be able instead of every month changing the "7" to the next period (I use this formula in several places) have all the IF statements refer to a particular cell that I change in one place. I would also use the same type reference for the year (see 1999).
Thank you for you time
David Stanley
DStan is offline   Reply With Quote
Old Mar 13th, 2002, 08:40 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-13 07:02, DStan wrote:
I use this array formula to filter and sum:
{=SUM(IF('BWP EXPENSE'!$A$2:$A$50000=10,IF('BWP EXPENSE'!$B$2:$B$50000>=740,IF('BWP EXPENSE'!$B$2:$B$50000<=749,IF('BWP EXPENSE'!$E$2:$E$50000=1999,IF('BWP EXPENSE'!$F$2:$F$50000<=7,'BWP EXPENSE'!$G$2:$G$50000,0),0),0))))}
My question is: IF('BWP EXPENSE'!$F$2:$F$50000<=7 where 7 = period or in our case January. I would like to be able instead of every month changing the "7" to the next period (I use this formula in several places) have all the IF statements refer to a particular cell that I change in one place. I would also use the same type reference for the year (see 1999).
Thank you for you time
David Stanley
David,

Are you using this formula in a single or multiple cells?

Do you really have data that fills the range 1 to 50000?

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Mar 13th, 2002, 08:55 AM   #3
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default


try

=SUM(($A$2:$A$5=10)*($B$2:$B$5>=740)*($B$2:$B$5<=749)*($E$2:$E$5=I2)*($F$2:$F$5=I3)*($G$2:$G$5))

I shortened your ranges to test.
Revise the criteria cells as necessary.
Dave Patton is offline   Reply With Quote
Old Mar 13th, 2002, 01:15 PM   #4
DStan
New Member
 
Join Date: Mar 2002
Posts: 6
Default

Quote:
On 2002-03-13 07:40, Aladin Akyurek wrote:
Quote:
On 2002-03-13 07:02, DStan wrote:
I use this array formula to filter and sum:
{=SUM(IF('BWP EXPENSE'!$A$2:$A$50000=10,IF('BWP EXPENSE'!$B$2:$B$50000>=740,IF('BWP EXPENSE'!$B$2:$B$50000<=749,IF('BWP EXPENSE'!$E$2:$E$50000=1999,IF('BWP EXPENSE'!$F$2:$F$50000<=7,'BWP EXPENSE'!$G$2:$G$50000,0),0),0))))}
My question is: IF('BWP EXPENSE'!$F$2:$F$50000<=7 where 7 = period or in our case January. I would like to be able instead of every month changing the "7" to the next period (I use this formula in several places) have all the IF statements refer to a particular cell that I change in one place. I would also use the same type reference for the year (see 1999).
Thank you for you time
David Stanley
David,

Are you using this formula in a single or multiple cells?

Do you really have data that fills the range 1 to 50000?

Aladin
Aladin

This is a single cell formula. I am importing data from access database and used large number because 5000 wasn't enough so I added a zero. Should I reduce this number?
DStan is offline   Reply With Quote
Old Mar 13th, 2002, 01:49 PM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-03-13 12:15, DStan wrote:
Quote:
On 2002-03-13 07:40, Aladin Akyurek wrote:
Quote:
On 2002-03-13 07:02, DStan wrote:
I use this array formula to filter and sum:
{=SUM(IF('BWP EXPENSE'!$A$2:$A$50000=10,IF('BWP EXPENSE'!$B$2:$B$50000>=740,IF('BWP EXPENSE'!$B$2:$B$50000<=749,IF('BWP EXPENSE'!$E$2:$E$50000=1999,IF('BWP EXPENSE'!$F$2:$F$50000<=7,'BWP EXPENSE'!$G$2:$G$50000,0),0),0))))}
My question is: IF('BWP EXPENSE'!$F$2:$F$50000<=7 where 7 = period or in our case January. I would like to be able instead of every month changing the "7" to the next period (I use this formula in several places) have all the IF statements refer to a particular cell that I change in one place. I would also use the same type reference for the year (see 1999).
Thank you for you time
David Stanley
David,

Are you using this formula in a single or multiple cells?

Do you really have data that fills the range 1 to 50000?

Aladin
Aladin

This is a single cell formula. I am importing data from access database and used large number because 5000 wasn't enough so I added a zero. Should I reduce this number?
There is indeed no need to have the formula to look at unused cells. And, you have data that apparently changes over time. That calls for dynamically computing the ranges of interest.

It looks like column G in BWP EXPENSE is of numeric type, which we can use for that purpose.

May I suggest that you modify the name of the sheet to just BWPexpense (no space), although it doesn't matter at all how it's called to what follows.

Activate Insert|Name|Define.
Type "EndRow" in the Names in Workbook box.
Enter as formula in the 'Refers To' box:

=MATCH(9.99999999999999E+307,BWPexpense!$G:$G)

Click OK.

Activate the sheet where you want the formula.

In E1 enter: 10
In E2 enter: 740
In E3 enter: 749
In E4 enter: 1999
In E5 enter: 7

These are criteria/conditions that you appear to use.

You can also use, as noted by Dave Patton, a normally entered SUMPRODUCT formula instead of an array formula, in which the definite references are replaced with dynamically computed ranges by using the OFFSET worksheet function:

=SUMPRODUCT((OFFSET(BWPexpense!$A$2,0,0,EndRow-1,1)=E1)*(OFFSET(BWPexpense!$B$2,0,0,EndRow-1,1)>=E2)*(OFFSET(BWPexpense!$B$2,0,0,EndRow-1,1)<=E3)*(OFFSET(BWPexpense!$E$2,0,0,EndRow-1,1)=E4)*(OFFSET(BWPexpense!$F$2,0,0,EndRow-1,1)<=E5),OFFSET(BWPexpense!$G$2,0,0,EndRow-1,1))

That should do it.

You should not need to touch this formula whenever you choose a defferent set of criteria/conditions and/or the number of records change in the data area.

Aladin
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 11:43 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