Macro + Excel functions: Braking a cell value in random number of parts to keep total same;each part mentioned in different cell;

darpandce

New Member
Joined
Apr 5, 2013
Messages
1
Dear Excel Experts,

I have problem:

I have a column (say, A) having 1000 values; ranging from anything 2 to 35 in each of the cell of that column.

suppose, cell A1 has value of 20. I need to divide this value of 20 in some 'random' number of parts.. e.g., mentioning randbetween (1,5)..so that sum of all the parts should equal to 20 only.. and each part should be integer. again, i have no fixed percentage that each part would be having.

Also, each part must be put into a separate column .i.e., if 20 has been broken into 4 parts of 6,9,4,1 .. then these numbers will be put in different column say.. D1,D2,D3,D4...

once i do it for single cel... then I need to run this for all 1000 cells mentioned in column 'A'... with each split entry getting appended after the last division of entries.... eg.. '20' was divided into D1,D2,D3,D4.....so, next cell value, once divided, will continue from D5, D6, D7.. etc..


Please help urgently
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Is there a minimum/maximum number of parts you would want?

E.g.

For the number 2 is 1 part ok and for 2 to be transferred over or would you like it to always be 1, 1?
Similarly for 20 would 20 parts be ok 1,1,1,etc?
 
Upvote 0

Forum statistics

Threads
1,215,510
Messages
6,125,228
Members
449,216
Latest member
biglake87

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