JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,687
- Office Version
- 365
- Platform
- Windows
I thought I understood this from some previous discussions here, but apparently I do not.
This table shows three different ways to calculate the number of days between two dates. Column C has been assigned the name "Date".
The first one (Col D), uses relative cell addresses. The second uses the named range for the first term, but a cell reference in the Offset call. Both of these work.
The third one, which uses the named range in the Offset call, gets an error.
I tried several variations that I thought were suggested by various people here, but none of them work.
The expression
, gets an error.
My attempt to use intersect operator,
, gets an error.
Is there a simple expression to subtract the date in the previous row from the one in the current row that uses only the named range (no cell references)?
This table shows three different ways to calculate the number of days between two dates. Column C has been assigned the name "Date".
The first one (Col D), uses relative cell addresses. The second uses the named range for the first term, but a cell reference in the Offset call. Both of these work.
The third one, which uses the named range in the Offset call, gets an error.
R/C | C | D | E | F | G | H | I |
5 | Date | Days | Formula | Days | Formula | Days | Formula |
6 | 4/06/20 | 5 | D6: =C6-C7 | 5 | F6: =Date-OFFSET(C6,1,0) | #REF! | H6: =Date-(OFFSET(Date,1,0)) |
7 | 4/01/20 | 40 | D7: =C7-C8 | 40 | F7: =Date-OFFSET(C7,1,0) | #REF! | H7: =Date-(OFFSET(Date,1,0)) |
8 | 2/21/20 | 98 | D8: =C8-C9 | 98 | F8: =Date-OFFSET(C8,1,0) | #REF! | H8: =Date-(OFFSET(Date,1,0)) |
9 | 11/15/19 | n/a | n/a | n/a | n/a | n/a |
I tried several variations that I thought were suggested by various people here, but none of them work.
The expression
VBA Code:
=Date-(OFFSET(+Date,1,0))
My attempt to use intersect operator,
VBA Code:
=Date-(row(H6)+1 Date)
Is there a simple expression to subtract the date in the previous row from the one in the current row that uses only the named range (no cell references)?