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>
 
B5 copied across
=MAX(MIN(B3,$J$4-SUM(B3:$I3)+B3),0)

M.[/QUOTE]

IT WORKS. Thanks Marcelo Branco
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Marcelo Branco

Error is there in your formula....
 
Upvote 0
Formula in I5 is copied left.

Excel 2016
BCDEFGHIJ
35001000982700200500
41500
5081982700200500

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet4

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

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

<tbody>
</tbody>

[/QUOTE]

There ARE situation when H3="" & I3=""
Then your formula does not works. I have to manually punch 0s in H3 & I3 to achieve the result.

Can the formula be adjusted to take care of NULLs in B3:I3?
 
Upvote 0
hmm..
The formula is not working? Could you show a scenario where it didn't work?

M.

Here when NULL is in B3:I3
Sheet1 (2)

BCDEFGHIJ
308142,11224,989139,1931,598
4 817
500000817817817

<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>

Spreadsheet Formulas
CellFormula
B5=MAX(MIN(B3,$J$4-SUM(B3:$I3)+B3),0)
C5=MAX(MIN(C3,$J$4-SUM(C3:$I3)+C3),0)
D5=MAX(MIN(D3,$J$4-SUM(D3:$I3)+D3),0)
E5=MAX(MIN(E3,$J$4-SUM(E3:$I3)+E3),0)
F5=MAX(MIN(F3,$J$4-SUM(F3:$I3)+F3),0)
G5=MAX(MIN(G3,$J$4-SUM(G3:$I3)+G3),0)
H5=MAX(MIN(H3,$J$4-SUM(H3:$I3)+H3),0)
I5=MAX(MIN(I3,$J$4-SUM(I3:$I3)+I3),0)

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Small adjustment to handle blank cells...


B
C
D
E
F
G
H
I
J
3
0​
814​
2112​
24989​
139193​
1598​
4
817​
5
0​
0​
0​
0​
0​
817​
0​
0​

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

M.
 
Upvote 0
If the cells in B3:I3 contain formulas that, in some cases, return null string (""), then try

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

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

M.[/QUOTE]
IT WORKS. Thanks Marcelo Branco
 
Upvote 0

Forum statistics

Threads
1,214,785
Messages
6,121,543
Members
449,038
Latest member
Guest1337

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