View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Cell reference in Excel

"Arne Hegefors" wrote:
Thanks! But I have real trouble with this syntax when it gets a bit more
complex. There must be some way of writing so that one cell shows the rate
found in e.g. F10, the next F15, then F20 etc. It seems very easy but as I
said I have not managed..Any help on this subject is vey much appreciated!


First ..
=INDEX(A:A,ROW(A2)*5-5)


although the above works, it should have been the simpler:
=INDEX(A:A,ROW(A1)*5)
My error, sorry

ROW(A1)*5 is simply used as an incrementer within the INDEX formula to
generate the series: 5,10,15, etc as we copy the formula down from the start
cell, in this case, B1. You can see this happening by putting in any starting
cell, say in K2: =ROW(A1)*5 then copy K2 down. In K3 the formula will become:
=ROW(A2)*5, in K4: =ROW(A3)*5, and so on. As ROW(A1) simply returns 1,
ROW(A2) returns 2, and so on, hence we'd get the series: 5, 10, 15, etc
generated in K2 down. This numeric series is used as the INDEX's row param to
extract what's in A5, A10, A15, etc. In INDEX(A:A, ...), the "A:A" means the
index is for the entire col A, from A1 down. INDEX(A:A,1) returns whats in
A1, INDEX(A:A,5) returns what's in A5, and so on. Hope this clarifies it a
little better.

I'd normally use ROW(A1) out of "convention". ROW(B1), ROW(C1), etc all
return the same as ROW(A1), and will increment in a similar fashion, too,
when copied down. These could have been used instead as the incrementer in
this instance.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---