Excel is driving me crazy. I've been working on a formula in Excel 97 that ended up being pretty complex. To make it easier to read I started breaking it down into pieces using named formulas (Insert > Name > Define). Now I'm hitting a roadblock with Excel's handling of named formulas.
Basically, the ROW() function is not working when nested within the SUM() function in a named formula, and I have no idea why.
Here is my test data:
This is a small part of my overall formula that illustrates the specific problem I'm posting about. I'm using the constants 4 and -1 here to simplify the test. In my actual formula those values are calculated dynamically.
I'll refer to my named formula as "Daily_total".
Why is this happening?
Basically, the ROW() function is not working when nested within the SUM() function in a named formula, and I have no idea why.
Here is my test data:
Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
1 | ||||
2 | ||||
3 | ||||
4 | 2 | |||
5 | 3 | |||
6 | 4 | |||
7 | 5 | |||
8 | ??? | |||
... |
This is a small part of my overall formula that illustrates the specific problem I'm posting about. I'm using the constants 4 and -1 here to simplify the test. In my actual formula those values are calculated dynamically.
I'll refer to my named formula as "Daily_total".
Code:
*** 1 ***
Daily_total:
=SUM( OFFSET( B8, ( 4 - ROW() ), -1, 4 ) )
Formula in B8:
=Daily_total
Result: #VALUE!
*** 2 ***
Daily_total:
=SUM( OFFSET( B8, ( 4 - ROW( B8 ) ), -1, 4 ) )
Formula in B8:
=Daily_total
Result: #VALUE!
*** 3 ***
Daily_total:
N/A
Formula in B8:
=SUM( OFFSET( B8, ( 4 - ROW() ), -1, 4 ) )
Result: 14
*** 3 ***
Daily_total:
=SUM( OFFSET( B8, ( 4 - 8 ), -1, 4 ) )
Formula in B8:
=Daily_total
Result: 14
*** 4 ***
Daily_total:
=OFFSET( B8, ( 4 - ROW() ), -1, 4 )
Formula in B8:
=SUM( Daily_total )
Result: 14
Why is this happening?