On 02/16/15 00:35, Brian Barker wrote:
> At 22:20 15/02/2015 -0700, Gary Aitken wrote:
>> I can't find how to do this in the docs; not even sure it's
>> possible but seems like it should be. Assume column A is named
>> "foo" (select column, insert/name/define). In column B I can use
>> the corresponding element in the same row in A in a formula by
>> using its name, e.g. =foo*3
>> 
>> Is there a way to reference a cell in column "foo" (A) relative to
>> the row in which the formula is being defined? What I want to do is
>> subtract the previous row value from the current row one: =foo -
>> [foo-1] How do I say that?
> 
> =foo-INDEX(foo;ROW()-1)

Thanks; that was what I needed.

> Mind you, I'm not at all sure why you would want to do this. Column A
> already has a perfectly serviceable name: "A"! Why not have in B2
> just =A2-A1 and so on?

Because formulas are much more meaningful when the names used in them
have some link to the reality they represent.
  NetUse = NetDeliveredToUs - NetFedToGrid
makes much more sense than "G2 = E2 - F2"
In the example above, 
  NetDeliveredToUs = KWHDeliveredToUs - INDEX(KWHDeliveredToUS;ROW()-1)

Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to