View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default decrease integers to zero

You're going to have to use a second column, because of the circular logic
effect. However, you could hide the 1st column once you've got it setup,
giving the appearance of what you want.

In helper column (say, column C) setup your total the same as your B column.
In last cell before total (C17) input this formula:
=IF(B180,B17+1,B17)
In C16, input:
=B16+MIN(1,MAX(0,$B$18-COUNTA($C$17:C17)))
Copy this all the way up to the top of your numbers (in your example, would
be C2).

Note that to make things easier to update when you hide the column, you
should change B1 to reference C1 (=C1) so that you don't have to unhide it to
make a change.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Andi" wrote:

I've looked around for this issue and can't seem to find one - my apologies
for any duplications.

At the top of Column B, I have a total amount. I have a formula based
calculation in Column B. Based on these numbers, I have a 'running total' at
the bottom of Column B. (B1-sum(B2:B17)). Some of the cells formuals come
to zero at the bottom cells of the column. I would like to add 1 to each
cell, starting with those that have a zero and then back to the top with the
higher numbers until the 'running total' is zero.

Here's what it looks like:
Total Available 62
A 16
B 12
C 9
D 7
E 5
F 0
G 0
H 0
I 0
J 0
K 0
L 0
M 0
N 0
O 0
P 0
Running Total 13
Here's what I want the end result to be, without having to manually enter
the information:

Total Available 62
A 17
B 13
C 9
D 7
E 5
F 1
G 1
H 1
I 1
J 1
K 1
L 1
M 1
N 1
O 1
P 1
Running Total 0


Any ideas? I keep running into circular reference issues that I'm just not
good at.
Any help is appreciated! This is part of a bigger revamp of a spreadsheet.