LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 61
Default How to calculate (generate) a cell reference

I need a way to generate a cell address (row,column) from the value in
another cell and be able to use the contents of that in a calculation.

Here's my situation:

I have a table of mileage readings for my car taken at odd intervals.
Note that the "[Row]" column is the actual row number in the
spreadsheet and not part of the data. It is included because I want to
reference it later.

[Row] Date Odom Miles Days Mos Yrs M/Dy M/Mo Mi/Yr
13 3/13/05 48,041 1,141 50 1.64 0.14 23 695 8,335
14 7/10/05 50,922 2,881 119 3.91 0.33 24 737 8,843
15 10/29/05 52,176 1,254 111 3.65 0.30 11 344 4,126
16 12/15/05 55,338 3,162 47 1.54 0.13 67 2,048 24,573
17 5/01/06 57,767 2,429 137 4.50 0.38 18 540 6,476
18 6/30/06 58,494 727 60 1.97 0.16 12 369 4,426
19 10/12/06 62,144 3,650 104 3.42 0.28 35 1,068 12,819
20 2/02/07 65,368 3,224 113 3.71 0.31 29 868 10,421
21 3/12/07 65,719 351 38 1.25 0.10 9 281 3,374

The last column calculates the annualized miles/year based on the last
two readings. The reading are at irregular intervals, which makes it
difficult to calculate average mileage.

My idea was to add a row or two at the bottom of the table where I
would calculate the averages across enough intervals to span a year or
two. I could do the last 3 or 4 or 5 intervals and that would probably
be good enough, but what I'd like to do (maybe more for the learning
experience than the actual usefulness) is to add a new column (Row) in
which I could put the row number of the interval I want to compare
with. I could then choose an interval that is close to 1 or 2 or 3
years back and get the desired averages.

Here is an example using the data from the table above and choosing
rows that are about 1 and 2 years back. The new "Row" column is where
I would put the row number that I want to compare the last row in the
table against:

[Row] Row Date Odom Miles Days Mos Yrs M/Dy M/Mo Mi/Yr
23 16 12/15/05 55,338 10,381 452 14.85 1.24 23 699 8,389
24 13 3/13/05 48,041 17,678 729 23.95 2.00 24 738 8,857

This table was generated using actual cell references. The date cell
is "=B16", the Odom cell is "=C16", the Miles cell is "=C21-C16", and
the Miles cell is "=B21-B16".

What I need is a way to replace the "16" in each of these formulas
with the contents of cell A23. I can't seem to quite get it to work.

I think the solution is some combination of the cell() function and
the address() function, but I can't get it to work.

Using the address() function, I was able to obtain the address of the
cell:

=ADDRESS(A26,2) == "$B$16"
=ADDRESS(A26,2,4) == "B16"

Using the cell() function, I was able to obtain the contents of the
cell:

=CELL("contents",B16) == 12/15/05
=CELL("contents",C16) == 55,338

But when I try to combine these functions, I get an error:

=CELL("contents",ADDRESS(A26,2,4)) == Error

What am I doing wrong?

--
Running Excel 2000 SP-3 on Windows 2000
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto calculate absolute cell reference Teri Excel Discussion (Misc queries) 3 March 5th 07 09:00 PM
Formula 'mis' calculate when reference cell contains a "0" Rachel Excel Discussion (Misc queries) 1 December 12th 06 07:43 PM
generate a random number and use if function to generate new data Dogdoc1142 Excel Worksheet Functions 4 April 26th 06 03:44 AM
Generate random numberes using reference to the other cell. ramana Excel Worksheet Functions 7 October 31st 05 07:09 AM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM


All times are GMT +1. The time now is 01:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"