# Auto-fill rows between two cells in iWork - Numbers (or MS Excel)

This is my table

``````...A............
1  1
2
3
4
5  9
``````

I know the minimum value (A1=1) and I know the maxiumum value (A5=9). Now I want to fill the rows in between with the numbers leading up to the maximum value.

So it looks like this:

``````...A............
1  1
2  3
3  5
4  7
5  9
``````

How can I do this in iWork Numbers? (maybe its the same as in Excel?)

-

Put this into cell A2 (this works for Excel 2007) and drag down:

`=A1+(\$A\$5-\$A\$1)/(ROW(\$A\$5)-ROW(\$A\$1))`

Basically, this figures out how many rows between your first and last, then what the difference is between the two values, then adds that value-per-cell calculation to the preceding cell.

-
Thanks it worked in Numbers too. – mdc Sep 22 '10 at 19:55

In Excel, select the range that includes your starting and ending cells. In the Home ribbon, in the Editing section, click Fill, select Series, click OK and you're done.

-
Thanks, I actually dont have Excel so I cant test it but Im sure it works :) – mdc Sep 22 '10 at 19:57
+1 - This is good to know if you are using just Excel! – JNK Sep 22 '10 at 20:02
@mdc: Well, your title and one of your tags say "Excel". – Dennis Williamson Sep 23 '10 at 2:52
Thats because there could be a solution that works in both Numbers and Excel (like the one JNK provided). – mdc Sep 23 '10 at 5:46

Here's my VBA answer, that will be easy to modify to do what you want.

-