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 14th, 2002, 08:52 AM   #1
garon
New Member
 
Join Date: May 2002
Location: Iceland
Posts: 2
Default

in my small community we have an Election date coming up on 25th of May. There are 4 partys against each other trying to force their people in to a 9 person town council. Is there any simple way to set up an Excel file in which you can give each party an imaginary number of votes and then you could see the number of persons they get elected in the town council.

Is there any way to get a decent formula behind these calculations so I can see in an instant how many men each party gets after I have entered the votes in the first column??
garon is offline   Reply With Quote
Old May 14th, 2002, 10:03 AM   #2
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

I would imagine so....

if there's 2,000 votes and Party A gets 200 of them, would it mean that they get 200/2,000 x 9 seats on the council ?

etc etc ?

what are the rules when there is no whole number ?
__________________
:: Pharma Z - Family drugstore ::
Chris Davison is offline   Reply With Quote
Old May 14th, 2002, 04:57 PM   #3
garon
New Member
 
Join Date: May 2002
Location: Iceland
Posts: 2
Default

The rules are:
f.e. 2000 votes
Party A gets 800 Party B gets 400
Party C gets 600 Party D gets 200.
Then you divide in each party´s votes first with 2, then 3, then 4 and so on. Then you find out the highest 9 numbers.
F.e. Party A has 800 behind their 1. man, 400 behind their 2. 266.67 behind their 3.man and 200 behind their 4. man.
Does this explain?
garon is offline   Reply With Quote
Old May 14th, 2002, 06:01 PM   #4
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

a bit long-winded, but does this help ?

Microsoft Excel - garon.xls_______________Running: xl97 : OS = Windows (32-bit) 4.90
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp
K2=
ABCDEFGHI
1PartyVotes1234567
2A1234:alert('=+$B2/C$1')>1,234.00:alert('=+$B2/D$1')>617.00:alert('=+$B2/E$1')>411.33:alert('=+$B2/F$1')>308.50:alert('=+$B2/G$1')>246.80:alert('=+$B2/H$1')>205.67:alert('=+$B2/I$1')>176.29
3B1758:alert('=+$B3/C$1')>1,758.00:alert('=+$B3/D$1')>879.00:alert('=+$B3/E$1')>586.00:alert('=+$B3/F$1')>439.50:alert('=+$B3/G$1')>351.60:alert('=+$B3/H$1')>293.00:alert('=+$B3/I$1')>251.14
4C1563:alert('=+$B4/C$1')>1,563.00:alert('=+$B4/D$1')>781.50:alert('=+$B4/E$1')>521.00:alert('=+$B4/F$1')>390.75:alert('=+$B4/G$1')>312.60:alert('=+$B4/H$1')>260.50:alert('=+$B4/I$1')>223.29
5D1244:alert('=+$B5/C$1')>1,244.00:alert('=+$B5/D$1')>622.00:alert('=+$B5/E$1')>414.67:alert('=+$B5/F$1')>311.00:alert('=+$B5/G$1')>248.80:alert('=+$B5/H$1')>207.33:alert('=+$B5/I$1')>177.71
6PartySeats
7:alert('=+A2')>A:alert('=SUM(C7:I7)')>2:alert('=IF(RANK(C2,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(D2,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(E2,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(F2,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(G2,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(H2,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(I2,$C$2:$I$5,0)<=9,1,0)')>0
8:alert('=+A3')>B:alert('=SUM(C8:I8)')>3:alert('=IF(RANK(C3,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(D3,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(E3,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(F3,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(G3,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(H3,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(I3,$C$2:$I$5,0)<=9,1,0)')>0
9:alert('=+A4')>C:alert('=SUM(C9:I9)')>2:alert('=IF(RANK(C4,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(D4,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(E4,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(F4,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(G4,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(H4,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(I4,$C$2:$I$5,0)<=9,1,0)')>0
10:alert('=+A5')>D:alert('=SUM(C10:I10)')>2:alert('=IF(RANK(C5,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(D5,$C$2:$I$5,0)<=9,1,0)')>1:alert('=IF(RANK(E5,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(F5,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(G5,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(H5,$C$2:$I$5,0)<=9,1,0)')>0:alert('=IF(RANK(I5,$C$2:$I$5,0)<=9,1,0)')>0
11 :alert('=SUM(B7:B10)')>9
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

__________________
:: Pharma Z - Family drugstore ::
Chris Davison is offline   Reply With Quote
Old May 14th, 2002, 06:07 PM   #5
Chris Davison
MrExcel MVP
 
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
Default

Colo / Ivan : this is a fantastic tool

thanks from all of us who use it, for putting the time and effort into its development

sincerely,
Chris
Chris Davison 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 09:53 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