Macro Generate Numbers with Condition

joram7

Board Regular
Joined
May 12, 2005
Messages
115
I need help with a macro where numbers are auto generated in the highlighted yellow cell based on the condition below. The numbers should be trigger based on the percentage allocated.

Condition
For Scenario A,B,C all total must be equal or higher than Cost A
Round up to 0 decimal
All scenario are trigger by the percentage allocation ( % is determine mannualy)

Scenario B
Domestic must be 30
Regional must not be lower than 30 and higher than 60
International must be 60 or higher

Scenario C
Domestic must be 30
International must not be lower than 30
Sample - Mr-excel question.xls
CDEFGHI
8
9
10NumberofCount1,0001,0001,000
11
12
13ScenarioABC
14
15RangeValueRangeValueRangeValue
16International59Domestic30Domestic30
17Regional55International80
18International65
19
20
21
22
23TierAllocationRangePercentageRangePercentageRangePercentage
24Tier1International100.0%Domestic20.0%Domestic10.0%
25Tier2 Regional50.0%International90.0%
26Tier3 International30.0% 
27Tier4   
28Tier5
29
30
31
32Total59,00053,00075,000
33CostA58,21158,21158,211
34
35
Fee_Scenario
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Your information doesn't make much sense.

Solve for International, Domestic and Regional and you get 1000, 333.333... and -400 respectively. How you're determining anything is totally unknown to us. Try explaining more clearly with a step-by-step example of how you'd solve the problem now, what your logic is, and where you're getting your data from.
 
Upvote 0
Take a look at Excel's Solver (Tools | Solver...) You can use it to adjust the % numbers so that the final numbers match your requirement.
I need help with a macro where numbers are auto generated in the highlighted yellow cell based on the condition below. The numbers should be trigger based on the percentage allocated.

Condition
For Scenario A,B,C all total must be equal or higher than Cost A
Round up to 0 decimal
All scenario are trigger by the percentage allocation ( % is determine mannualy)

Scenario B
Domestic must be 30
Regional must not be lower than 30 and higher than 60
International must be 60 or higher

Scenario C
Domestic must be 30
International must not be lower than 30

{snip}
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,788
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top