Help with VB in excel

MisterR

New Member
Joined
Jun 22, 2015
Messages
3
Hi guys! I am really newbie in making my formulas in excel...I mean i can calculate with simple formulas and If statements, but i am really bad in other more complex stuff..So i need some help and i would appretiate it if you can help me with the following situation:
I have to make a formula with which to distribute a common sum in the cells to the right (the same row) according to a givven quota. After the common sum falls down below the givven quota, i have to write the ending balance in the last cell.
Here is the chart:
[TABLE="class: grid, width: 50, align: left"]
<tbody>[TR]
[TD]Common sum[/TD]
[TD]Quota[/TD]
[TD][/TD]
[TD]Cell1[/TD]
[TD]Cell2[/TD]
[TD]Cell3[/TD]
[TD]Cell4[/TD]
[TD]Cell5[/TD]
[/TR]
[TR]
[TD]5000[/TD]
[TD]1000[/TD]
[TD][/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]4500[/TD]
[TD]1000[/TD]
[TD][/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]500[/TD]
[/TR]
</tbody>[/TABLE]






I would be really glad if you can help me with this problem because i cannot find a solution for it by myself!
Thanks a lot guys!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi, welcome to the forum.

Your thread title suggests you are looking for VBA code, but maybe a formula will suffice?


Excel 2012
ABCDEFGHI
1Common sumQuotaCell1Cell2Cell3Cell4Cell5Cell5
250001000100010001000100010000
34500100010001000100010005000
43150600600600600600600150
Sheet1
Cell Formulas
RangeFormula
D2=MAX(0,MIN($A2-$B2*(COLUMNS($D2:D2)-1),$B2))
 
Upvote 0
in cell D2 put the formula as
Code:
MIN(A2,B2)
and copy the formula for the entire column

In cell E2,
Code:
MIN($A2-SUM($D2:D2),$B2)
and copy it in the remaining cells
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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