View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default expanding numbers?

If I understand what you want to do (and it is not entirely clear given your
example numbers), put your start number (75) in A1, your ending number
(30000) in B1 and the number of cells you want to step across (20) in C1.
Now, to be perfectly clear what I am doing, putting 20 in C1 means the first
number (75) will be in A1 and the last number (30000) will be in A20... that
is, we are splitting the number across 20 cells for your given example.
Okay, if that is correct, put this formula in cell A2....

=IF(ROW(A2)<=$C$1,$A$1+(ROW(A2)-1)*($B$1-$A$1)/($C$1-1),"")

and copy it down to the last possible row you will ever want to split your
numbers across.

Now, a word about this process. You may not get the numbers you think you
should get. Why? Well, most people assume that if, say, the starting number
is 0 and the ending number is 20, and you split that over 20 cells (A1 to
A20), that each cell will increase by 1. That is not correct, however. There
are only 19 intervals between A1 and A20, not 20; so the difference in cells
is not 1; but, rather, 20 divided by 19, which is about 1.052631579. To get
a nice progression of 1 between cells, you would need to step across 21
cells (20 intervals) A1 to A21.

Rick


"Pendal" wrote in message
...
I'm not sure how to title this post. But this is what i want to do.

I need to take two variable numbers say 75 and 30000.

Then I need to step out the difference over a variable amount of cells. in
this case say 20 cells.

the output should look something like this.

75
80
93
123
178
320
...
...
...
30000

is there anyway to do this without lines and lines of code?

thanks