Excel Formulas to generate random values adding upto 100

coolguyvarun01

New Member
Joined
Jan 5, 2015
Messages
27
Office Version
  1. 2019
Platform
  1. Windows
Hi Experts,

Need your help in this. My boss wants me to create values for a group of materials bifurcated on basis of pack x Channel, now the values for a pack/channel combination should sum up to 100.


[TABLE="width: 320"]
<tbody>[TR]
[TD="class: xl65, width: 64"]Unit[/TD]
[TD="class: xl65, width: 64"]Brand[/TD]
[TD="class: xl65, width: 64"]Channel[/TD]
[TD="class: xl65, width: 64"]Pack[/TD]
[TD="class: xl65, width: 64"]Value%[/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl65"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]EAST[/TD]
[TD="class: xl66"]Product 1[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]WEST[/TD]
[TD="class: xl66"]Product 2[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]NORTH[/TD]
[TD="class: xl66"]Product 3[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Spoke[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]TT Retail[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]SAMT[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Railways[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Extra Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]Insti[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Large[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Medium[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl65"]SOUTH[/TD]
[TD="class: xl66"]Product 4[/TD]
[TD="class: xl66"]WS[/TD]
[TD="class: xl66"]Small[/TD]
[TD="class: xl66"][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Assuming that your example table is in A1:E73, in E2 enter

=RAND()

In F2, enter

=E2/SUMIFS($E$2:$E$73,$C$2:$C$73,C2,$D$2:$D$73,D2)

Fill both formulas down to the end of the table, format column F as percentage.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,813
Messages
6,181,109
Members
453,021
Latest member
Justyna P

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