Automatically adding cells with values

G

Guest

Hard for me to explain my situation so I'll try to give an example:

Let's say there are two parts to the worksheet.
One part is cell A1 which has a number that is supposed to be changed by the
user manually. The second part is based on cell A1. Let's say i have the
numbers 0,1,2,3 and 4 in cells B5, B6, B7, B8, and B9 respectively. IF cell
A1 has the number 4 than cells B5-B9 should have 0-4 respectively (B5 has #0,
B6 has #1, etc.).

If cell A1 has 8, than more cells should be added automatically to get
B5-B13 each with a value from 0-8. (B5 has #0, B6 has #1, B18 has the #8)

Basically, the value of cell A1 should determine how many more cells get
added. And each added cell should have its own number. If A1 becomes 15
than cells should be added in column B all the way until cell B20. (B5 has
the #0, B10 had the #5, B15 has the #10, B20 has the #15)

Hopefully someone can put these numbers on a spreadsheet to see what I need.
I just need to find a way for excel to automatically add each cell or
subtract each cell based on the changes in cell A1.

Thanks
 
G

Guest

One way which might suffice ..

In B5:
=IF($A$1="","",IF(ROWS($1:1)-1>$A$1,"",ROWS($1:1)-1))
Copy B5 down to cover the max expected extent of numbering required, eg down
to B100?
 
G

Guest

Thanks Max
It worked great!

Max said:
One way which might suffice ..

In B5:
=IF($A$1="","",IF(ROWS($1:1)-1>$A$1,"",ROWS($1:1)-1))
Copy B5 down to cover the max expected extent of numbering required, eg down
to B100?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top