In order to do some calculations on averages and differences of values in columns, I've defined a name, based on a range, but it seems to be completely going berserk:
I have a cell (D13), defined as Header_First _Answer
, which contains the title of the column, and I have a value (currently being 69), which contains the number of entries, called Total_Count
.
I've defined the entries of that column as another name: "All_First_Answered_Dates", defined as =OFFSET(Header_First_Answer;1;0):OFFSET(Header_First_Answer;Total_Count;0)
(start by the first entry under Header_First_Answer
, take up to 69 entries, and define a range out of this).
In cell G5
, I'm using that name in order to do some calculations (calculating averages), but this seems not to work (there is a #Value
error).
After second comment from Rory: G5
formula and first formula evaluation result:
Formula:
=AVERAGE(IF(ISBLANK(All_First_Answered_Dates);TODAY();All_First_Answered_Dates) - All_Start_Dates)
First evaluation result:
=AVERAGE(IF(ISBLANK(#Value!);TODAY();All_First_Answered_Dates) - All_Start_Dates)
Hence, my conclusion:
After some checking I've found out that this is due to the name "All_First_Answered_Dates", which seems to be interpreted one time too many (or how do I explain this):
In different cells, I've entered the formula =OFFSET(Header_First_Answer;1;0):OFFSET(Header_First_Answer;Total_Count;0)
(which is exactly the meaning of "All_First_Answered_Dates"), and every time, using the Evaluate Formula
feature, I see that the last but one result is correct: $D$14:$D$82
. However, after that, another evaluation is done, turning this value into 43283 (in case the formula is entered in "J14"), 43300 (in case the formula is entered in "J15"), ..., and in case I enter this formula in a cell with row number lower than 14, I have the error value #Value
(which explains the wrong result in cell G5).
If I simply put the formula =$D$14:$D$82
in any of the mentioned cells, then the content of some cells in column D
are shown (which are dates, not values like 43283 or 43300).
It appears that declaring a range as =x:y
, where x
and y
are formula results, is not working.
Does anybody know how I can define a range as a formula, which I can then use in order to define in a name?
I can imagine my explanation being quite complicated without an image, hence the attached screenshot. In there:
- In cell J13, there is the formula
=OFFSET(Header_First_Answer;1;0):OFFSET(Header_First_Answer;Total_Count;0)
. - In cell J14, there is the same formula.
- In cell K14, there is the formula
=$D$14:$D$82
.
For completion purposes, hereby a screenshot of the name manager, containing both mentioned names (the ones, selected in the name manager):
Edit after first comment:
The idea behind the range is the following:
1. Take the first row under Header_First_Answer
, do not take any other column : OFFSET(Header_First_Answer;1;0)
2. Take the Total_Count
's row under Header_First_Answer
, do not take any other column : OFFSET(Header_First_Answer;Total_Count;0)
3. Define a range, based on those two cells, by putting a semicolon between them.
I was not aware of the height
and width
features of the Offset()
worksheet function. I've implemented them, which makes the formulas much easier.
Unfortunately the problem still persists.
Thanks in advance
Dominique
#VALUE!
? FYI, you don't need that construction anyway as you can use:=OFFSET(Header_First_Answer;1;0;Total_Count;1)
– Rory=Offset(…)
has no meaning as such, but in cell G5, there is a formula, using this as an input for calculating averages, this formula is having a problem and the "Evaluate Formula" feature indicates that the "Value!" error already appears on the evaluation of the offset calculation, hence my question. I've addedG5
formula and the first result of the formula evaluation to the question. – Dominique