# Can anyone offer code to solve this problem?

• 08-30-2013, 03:22 PM
alan.fulton
Can anyone offer code to solve this problem?
I am hoping to find a simple code or even a function to include in excel to figure out this problem below, any ideas are welcomed and please keep in mind that I am a newbie.

I am not sure what a correct term would be (so if you know, please tell me), but I will describe the situation. There is a total number of people from the list that must be selected, each person costs X and will produce Y. I want to be able to list many people with their cost(X) and production(Y) to offer the maximum total production(Y) for a total cost(X) which stays within the limits given.

Example, 3 people must be selected from below and the total cost must be 10.0 or less.

Person A costs 8 and will produce 10
Person B costs 7 and will produce 9
Person C costs 6 and will produce 15
Person D costs 3 and will produce 9
Person E costs 2 and will produce 5
Person F costs 1 and will produce 3
Person G costs 1 and will produce 1

in this example Person C, D and F total 10 and will produce 27.

I hope the way I am explaining this is correct and if anyone can offer any sort of help with this, I really look forward to hearing from you, thank you in advance.
Alan
• 08-31-2013, 03:31 PM
donatello
This is very simple and basic excel.

This is how a headcount section of a budget will work.
Simply make a 'key' in the top corner of a sheet in excel, then call the cells and do the math.
Excel is not something that relates to this forum, get a basic book on it, what you describe is basically child's play for the most inexperienced beginner with MS Excel.
• 09-01-2013, 08:36 AM
alan.fulton
Quote:

Originally Posted by donatello
This is very simple and basic excel.

This is how a headcount section of a budget will work.
Simply make a 'key' in the top corner of a sheet in excel, then call the cells and do the math.
Excel is not something that relates to this forum, get a basic book on it, what you describe is basically child's play for the most inexperienced beginner with MS Excel.

Thank you for your help Donatello. One final question, is it possible (and what's it called) if I wanted to take 1 name from "group 1" and three people from "group 2" - but still keep eveyone under a "total cost" and still result in the highest "production"
• 09-02-2013, 08:34 AM
donatello
Yes of course,
this is all part of the 'headcount' sheet of a normal budget.

Here's an example.
You will have to learn excel.

http://dropdowncombobox.com/demo/Excel-Demo.xlsx

You can change the non-shaded areas and it will calculate your costs.
The way to find an optimal is to use a function called 'Goal Seeking". This is very advanced Excel.

Good luck.

## X vBulletin 4.2.2 Debug Information

• Page Generation 0.11430 seconds
• Memory Usage 2,358KB
• Queries Executed 11 (?)
Template Usage (20):
• (1)bbcode_quote_printable
• (1)footer
• (1)gobutton
• (1)navbar_moderation
• (1)navbar_noticebit
• (2)option
• (1)spacer_close
• (1)spacer_open

Phrase Groups Available (3):
• global
• postbit
Included Files (19):
• ./global.php
• ./includes/class_bootstrap.php
• ./includes/init.php
• ./includes/class_core.php
• ./includes/config.php
• ./includes/functions.php
• ./includes/class_friendly_url.php
• ./includes/class_hook.php
• ./includes/class_bootstrap_framework.php
• ./vb/vb.php
• ./vb/phrase.php
• ./includes/functions_calendar.php
• ./includes/class_bbcode_alt.php
• ./includes/class_bbcode.php
• ./includes/functions_bigthree.php
• ./includes/functions_notice.php

Hooks Called (41):
• init_startup
• init_startup_session_setup_start
• database_pre_fetch_array
• database_post_fetch_array
• init_startup_session_setup_complete
• global_bootstrap_init_start
• global_bootstrap_init_complete
• cache_permissions
• fetch_foruminfo
• global_state_check
• global_bootstrap_complete
• global_start
• style_fetch
• global_setup_complete
• bbcode_fetch_tags
• bbcode_create
• bbcode_parse_start
• bbcode_parse_complete_precache
• bbcode_parse_complete
• cache_templates
• cache_templates_process
• template_register_var
• template_render_output
• fetch_template_start
• fetch_template_complete
• parse_templates