Fill values top down

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
B2:B9 is +ve Integers
C1 is Value
Output Required in D2:D9 as TO FILL VALUES STARTING D2 & Considering range B2:B9 TOP DOWN
Thanks in advance
Sheet1

BCD
1 2000
2400 400
3750 750
4800 800
51000 50
650 0
795 0
880 0
98000 0
10

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"></colgroup><tbody>
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Place this formula in cell D2 and copy down to cell D9:
Code:
=MAX(MIN(B2,$C$1-SUM(B$1:B1)),0)
 
Upvote 0
Place this formula in cell D2 and copy down to cell D9:
Code:
=MAX(MIN(B2,$C$1-SUM(B$1:B1)),0)

Joe What to do if values are HORIZONTAL (in ROWS) & to be adjusted from RHS to LHS
Sheet1

BCDEFGHIJ
35001000982700200500
4 1500
5 81982700200500

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"></colgroup><tbody>
</tbody>
 
Upvote 0
I do not understand the new layout your provided. I am not sure what those 9, 8, 2, and 81 number references are.
I am not sure what RHS and LHS stand for either.

Why the drastic change from the original format?
 
Last edited:
Upvote 0
What to do if values are HORIZONTAL (in ROWS) & to be adjusted from RHS to LHS
Like this?
Formula in I5 is copied left.


Excel 2016
BCDEFGHIJ
35001000982700200500
41500
5081982700200500
Sheet4
Cell Formulas
RangeFormula
I5=MAX(MIN(I3,$J$4-SUM(J3:$J3)),0)
 
Upvote 0
Or


B
C
D
E
F
G
H
I
J
3
500​
1000​
9​
8​
2​
700​
200​
500​
4
1500​
5
0​
81​
9​
8​
2​
700​
200​
500​

B5 copied across
=MAX(MIN(B3,$J$4-SUM(B3:$I3)+B3),0)

M.
 
Upvote 0
RHS Right Hand Side
LHS Left Hand Side

I am adjusting J4 in B3:I3
Output in B5:I5

Here
J4 1500
So 1st I3 adjusted & I5=500
Then Still balance left (1500>500)

So 2nd H3 adjusted & H5=200

& so on

I hope I am clear.
 
Upvote 0
It looks like you got two responses already on the recent request, so see if either (or both) work for you and post back.
 
Upvote 0

Worksheet Formulas
CellFormula
I5=MAX(MIN(I3,$J$4-SUM(J3:$J3)),0)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

[/QUOTE]

Great to see you Peter. IT WORKS. Thanks & Regards
 
Upvote 0

Forum statistics

Threads
1,214,592
Messages
6,120,433
Members
448,961
Latest member
nzskater

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