Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sigh, I'm drawing a blank....
E10:E30 evaluates to additional cash based on values in U10:U30. Ostensibly, E11 is U11-U10; similarly for E12:E30. I have named U10:U30 "Cash". So I want to write that formula in a form similar to: =Cash - offset(Cash,-1,0) Or so I thought. The OFFSET(...) expression is wrong. What is the correct expression for "the same row minus one in the named range Cash"? I am looking for a solution that is readable and self-documenting. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Bit cumbersome, but seems to work.
=OFFSET(INDEX(Cash,1),ROW()-MIN(ROW(Cash))-1,0) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message oups.com... Sigh, I'm drawing a blank.... E10:E30 evaluates to additional cash based on values in U10:U30. Ostensibly, E11 is U11-U10; similarly for E12:E30. I have named U10:U30 "Cash". So I want to write that formula in a form similar to: =Cash - offset(Cash,-1,0) Or so I thought. The OFFSET(...) expression is wrong. What is the correct expression for "the same row minus one in the named range Cash"? I am looking for a solution that is readable and self-documenting. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On May 27, 3:49 pm, "Bob Phillips" wrote:
Bit cumbersome, but seems to work. =OFFSET(INDEX(Cash,1),ROW()-MIN(ROW(Cash))-1,0) That's a start. Thanks. Based on that, I came up with the following: =index(Cash, row() - row(Cash)) It seems to work. But does it make sense? ROW(Cash) seems to return the first row number of Cash. I don't seem to need to do MIN(ROW(Cash)). But I don't know if I'm doing the "right" thing, or if I simply "got away with it". I thought that I did something even more straight-forward in the past. Is my INDEX(...) expression as good as it gets? (Assuming that it makes good sense, in the first place.) |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The reason that I used MIN(ROW(Cash)) was because ROW(Cash) returns an array
of all row numbers in the range Cash. If not used in an array formula, it seems to just use the first element, but I prefer to be explicit and force it to do so, hence the MIN. I tried that INDEX formula at first but it seems to suffer two problems to me: - first, it doesn't offset by one row as you seemed to ask - it repeats the first item as as the row numbers are 0, 1, 2, 3, etc., not 1,2,3, etc., but tjis can be corrected with =INDEX(Cash, ROW() - ROW(Cash)+1) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message oups.com... On May 27, 3:49 pm, "Bob Phillips" wrote: Bit cumbersome, but seems to work. =OFFSET(INDEX(Cash,1),ROW()-MIN(ROW(Cash))-1,0) That's a start. Thanks. Based on that, I came up with the following: =index(Cash, row() - row(Cash)) It seems to work. But does it make sense? ROW(Cash) seems to return the first row number of Cash. I don't seem to need to do MIN(ROW(Cash)). But I don't know if I'm doing the "right" thing, or if I simply "got away with it". I thought that I did something even more straight-forward in the past. Is my INDEX(...) expression as good as it gets? (Assuming that it makes good sense, in the first place.) |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On May 28, 1:54 am, "Bob Phillips" wrote:
I tried that INDEX formula at first but it seems to suffer two problems to me: - first, it doesn't offset by one row as you seemed to ask It offsets by one row just fine. If you fill U10:U30 with 1,2,...,21, define the name Cash to refer to $U$10:$U$30, and fill E11:E30 with =index(Cash,row()-row(Cash)), you will see that E11:E30 evaluates to 1,2,...,20. The reason that I used MIN(ROW(Cash)) was because ROW(Cash) returns an array of all row numbers in the range Cash. Only if ROW(Cash) were used in an array formula. In your previous posting, you did not indicate that your solution was an array formula. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() wrote in message oups.com... On May 28, 1:54 am, "Bob Phillips" wrote: I tried that INDEX formula at first but it seems to suffer two problems to me: - first, it doesn't offset by one row as you seemed to ask It offsets by one row just fine. If you fill U10:U30 with 1,2,...,21, define the name Cash to refer to $U$10:$U$30, and fill E11:E30 with =index(Cash,row()-row(Cash)), you will see that E11:E30 evaluates to 1,2,...,20. Maybe, but try putting it in E10:E30, you neither get the offset, and the first value is repoeated. Hence it is not very flexible. The reason that I used MIN(ROW(Cash)) was because ROW(Cash) returns an array of all row numbers in the range Cash. Only if ROW(Cash) were used in an array formula. In your previous posting, you did not indicate that your solution was an array formula. No, ROW returns an array regardless. Try evaluating the that part of the formula to see that this is so. As I said in my reply, ... if NOT used in an array formula, it seems to just use the first element, but I prefer to be explicit ... So I didn't indicate it was an array formula because it wasn't. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
automatic range - named range give me circular reference... | Excel Discussion (Misc queries) | |||
Named Range reference via single Cell | Excel Discussion (Misc queries) | |||
named range, offset self-reference | Excel Discussion (Misc queries) | |||
Using a formula to create named range reference | Excel Worksheet Functions | |||
How to dynamically reference a dynamic named range | Excel Worksheet Functions |