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 19th, 2002, 11:38 PM   #1
M.Young
New Member
 
Join Date: Mar 2002
Posts: 4
Default

I have a column with 20 rows of data (varying dollar amounts). The total of the 20 rows = $10,066.82. I have two different dollars amounts ($4,879.25 and $5,187.57 which are sub-totals of the 20 rows)that I have to identify the # of rows which add up to the $4,879.25 and the # rows that add up to the $5,187.57. Can this be done in a formula??
M.Young is offline   Reply With Quote
Old Mar 20th, 2002, 12:46 AM   #2
Russell
New Member
 
Join Date: Mar 2002
Posts: 39
Default

To get your subtotals are you using SUM or SUBTOTAL. If you are using SUBTOTAL change the function ref to 2
e.g
SUBTOTAL(9,C3:C5) will generate a subtotal of the cells C3:C5 using the SUM function
whereas
SUBTOTAL(2,C3:C5) will generate a subtotal of the cells C3:C5 using the COUNT function
(If you want to switch between the 2 then reference the function_ref to another cell which you change from 2 to 9

If you are just using SUM then use the corresponding COUNT(C3:C5)

Russell

Russell is offline   Reply With Quote
Old Mar 20th, 2002, 12:47 AM   #3
sam_d1
Board Regular
 
Join Date: Mar 2002
Location: India
Posts: 50
Default

sam_d1 is offline   Reply With Quote
Old Mar 20th, 2002, 12:57 AM   #4
sam_d1
Board Regular
 
Join Date: Mar 2002
Location: India
Posts: 50
Default

(a) Ensure your data is on A2:A21.
(b) Enter the first Cut of Value in B24
(c) Cut and paste the following formula in B2
=IF(A2+B1>=B$24,0,A2+B1)
(d) Drag (or copy & paste) B2 till B21.
(e) You should be having a '0' in one of the cells in B2:B21 (say Bn)
(f) The cells A2:An is your first set and rest the second.
(g) Change '>=' in (c) to '=' for exact match

Please tell me if this solved your problem
- sam
sam_d1 is offline   Reply With Quote
Old Mar 20th, 2002, 02:18 AM   #5
M.Young
New Member
 
Join Date: Mar 2002
Posts: 4
Default

These are the 20 different amounts. Some combination of these amounts will equal $4,879.25 and the remainder will equal $5,187.57. It's not as easy as just sub-totaling.
15.55
22.42
58.48
82.74
85.18
172.93
208.89
231.20
244.38
321.78
419.80
499.85
604.24
641.53
869.02
964.20
1,008.79
1,126.70
1,231.87
1,257.27


[ This Message was edited by: M.Young on 2002-03-20 01:20 ]
M.Young is offline   Reply With Quote
Old Mar 20th, 2002, 03:05 AM   #6
Russell
New Member
 
Join Date: Mar 2002
Posts: 39
Default

How do you calculate the subtotals at the moment? Is it just a number you are given?

Russell
Russell is offline   Reply With Quote
Old Mar 20th, 2002, 06:37 AM   #7
M.Young
New Member
 
Join Date: Mar 2002
Posts: 4
Default



[ This Message was edited by: M.Young on 2002-03-20 05:52 ]
M.Young is offline   Reply With Quote
Old Mar 20th, 2002, 07:11 AM   #8
M.Young
New Member
 
Join Date: Mar 2002
Posts: 4
Default

Right now, we calculate it out manually. We get the sub-totaled amounts from another office. Our office has the individual amounts (Bills). I have a report that I have to validate how many individual bills make up the sub-totaled amount given to me by the other office. There are usually other indicative entries on each line that help identify the bills within a sub-total. Ex. Type of bill, age of the bill, etc. In this case, all the indicative data is the same. Thus, we have a serious "Brain Teaser" that we have to sort out. I found the solution manually. It took only 8 hours. Not very efficient. I think this could be done with a formula, maybe not within Excell, but maybe within another Excell freindly software. The solution is:
$1,008.79
172.93
499.85
58.48
321.78
641.53
15.55
964.20
82.74
869.02
244.38
= $4,879.25

$1,126.70
1,231.87
1,257.27
208.89
85.18
231.20
419.80
604.24
22.42
= $5,187.57

[ This Message was edited by: M.Young on 2002-03-20 06:15 ]
M.Young is offline   Reply With Quote
Old Mar 20th, 2002, 07:33 AM   #9
Abdc
 
Join Date: Mar 2002
Posts: 20
Default

Just by way of note, with 20 numbers there are 1,048,575 possible combinations.
Abdc is offline   Reply With Quote
Old Mar 20th, 2002, 04:10 PM   #10
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Hi Abdc,

If the value cannot be obtained, that is equivalent to COMBIN(x,0), which is always 1, so change

{ =SUM(COMBIN(20,ROW(1:20))) }
= 1,048,575

to

{ =1+SUM(COMBIN(20,ROW(1:20))) }
=1,048,576

Just an exercise, as your point is very good.

Can anybody help to generalize this by making a reference to a cell rather than hardcoding the 20 in the formula?

This doesn't work (G1 is the reference cell)
=1+SUM(COMBIN(G1,INDIRECT("ROW(1:"&G1&")")))
array entered.

Any help greatly appreciated.

Thanks,
Jay

Jay Petrulis 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 10:51 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