Change Formula to use Named Range

  • Thread starter Thread starter QTE
  • Start date Start date
Q

QTE

Hi Excel Forum,

Can you assist with changing this formula

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

to use Defined Name Range "Office" instead of the absolute column "M"
The Defined Name Range has an Offset defined in the Name Refers T
box.

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

Formula:
=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Kind regards
QT
 
Hi Frank,

Thanks for suggestion but the formula needs to sum the next 9 rows u
from whatever the row number is.

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Frank said:
*Hi
why no use
=SUM(Office)

Further assistance greatly appreciated.

Kind regards
QT
 
Hi Frank,

Yes, the formula should always sum the 9 cells above the formula cell.
Frank said:
*Hi
should this fomurla sum always the 9 cells above the formula cell?
--
Regards
Frank Kabel
Frankfurt, Germany
Hi Frank,

Thanks for suggestion but the formula needs to sum the next 9 row up
from whatever the row number is.

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Kind regards
QT
 
Hi
try:
=SUM(INDIRECT("R" & ROW()-1 & "C(0):R" & ROW()-10 & "C(0)",FALSE))

--
Regards
Frank Kabel
Frankfurt, Germany

Hi Frank,

Yes, the formula should always sum the 9 cells above the formula cell.
 
Hi Frank,

Is it possible to do this using Defined Name Range. This is the Formula
already in use:

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Use Defined Name Range "Office" instead of the absolute column "M". The
Defined Name Range has an Offset defined in the Name Refers To box.

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)
Frank said:
*Hi
try:
=SUM(INDIRECT("R" & ROW()-1 & "C(0):R" & ROW()-10 & "C(0)",FALSE))
--
Regards
Frank Kabel
Frankfurt, Germany
Hi Frank,

Yes, the formula should always sum the 9 cells above the formula cell.
Kind regards
QTE
 
Hi
not sure why you're trying to use this defined name?. This name would
return a range reference starting in M11 with a height of the filled
cells within M:M

So I'm not sure why you want to use this name


--
Regards
Frank Kabel
Frankfurt, Germany

Hi Frank,

Is it possible to do this using Defined Name Range. This is the
Formula already in use:

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Use Defined Name Range "Office" instead of the absolute column "M".
The Defined Name Range has an Offset defined in the Name Refers To
box.

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)
 
Hi Frank,

I would like to know whether the Formula I'm currently using could b
applied to do the same calculation using a Defined Name rather tha
referencing a Column Letter, i.e "M" - could I achieve the same resul
with using a Named Range. The current formula already starts in M1
(taking account of the Offset) with a height of the filled cells withi
M:M.

Can the column reference "M" be replaced with a Name? If so, how?

Existing Formula:
=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

Kind regards,
QTE
Frank said:
*Hi not sure why you're trying to use this defined name?. This nam
would return a range reference starting in M11 with a height of th
filled cells within M:M
So I'm not sure why you want to use this name
--
Regards
Frank Kabel
Frankfurt, Germany
Hi Frank,

Is it possible to do this using Defined Name Range. This is the
Formula already in use:

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Use Defined Name Range "Office" instead of the absolute colum "M".
The Defined Name Range has an Offset defined in the Name Refers To
box.

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)
 
Hi
yes you can replace this with a name but not with a name definition
like your current one. Maybe you'll try to explain whyt you're trying
to do?

--
Regards
Frank Kabel
Frankfurt, Germany

Hi Frank,

I would like to know whether the Formula I'm currently using could be
applied to do the same calculation using a Defined Name rather than
referencing a Column Letter, i.e "M" - could I achieve the same result
with using a Named Range. The current formula already starts in M11
(taking account of the Offset) with a height of the filled cells
within M:M.

Can the column reference "M" be replaced with a Name? If so, how?

Existing Formula:
=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

Kind regards,
QTE
Frank said:
*Hi not sure why you're trying to use this defined name?. This name
would return a range reference starting in M11 with a height of the
filled cells within M:M
So I'm not sure why you want to use this name
 
Hi Frank,

I would like to use a Named Range in the Formula to make the column an
formula referencing more meaningful and transparent.

Kind regards
QTE
Frank said:
*Hi
yes you can replace this with a name but not with a name definitio
like your current one. Maybe you'll try to explain whyt you're tryin
to do?
 
QTE wrote...
...
Can the column reference "M" be replaced with a Name? If so,
how?

Existing Formula:
=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

The named range doesn't necessarily refer to the same range as given b
INDIRECT in the formula.

If you defined ColLtr as ="M", you could define foo referring to

=OFFSET(INDIRECT(ColLtr&"9"),2,0,COUNTA(INDIRECT(ColLtr&":"
&ColLtr)),1
 
Hi HGrove,

Thank you for further input and insight. However, it is the actua
=SUM Formula that I wish to use a Name as opposed to using colum
reference $M:

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

Hope I haven't misunderstood your explanation. If I have misunderstood
could you provide an example of what the actual SUM Formula would loo
like, based on your information in the Name Refers To Box.

Perhaps, I'm trying to do something that is not feasible.

Kind regards,
 
QTE wrote...
Thank you for further input and insight. However, it is the
actual =SUM Formula that I wish to use a Name as opposed to
using column reference $M:

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

OK, as-is, you could define MySumOfM as referring to

=SUM(INDIRECT("R[-9]C13:RC13",0))

If you mean for the M to be a variable, say, another defined name lik
ColLtr, which I gave in my previous response, then chage the definitio
of MySumOfWhatever to

=SUM(INDIRECT(ColLtr&(ROW()-9)&":"&ColLtr&ROW()))
Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

This is where you're EXTREMELY unclear. This dynamic range isn'
necessarily the same as the range in your SUM formula. How is th
latter relevant to the former. Rewriting yet again what you've alread
writter JUST WON'T EXPLAIN A DARN THING
 
HGrove,

As you can see from the quoted extract below and previously, my dynami
range is the same as the range in my =SUM Formula. Why is this EXTREMEL
UNCLEAR? You can see from the details given that the Dynamic Range an
SUM Range are the same in this instance and that the latter is relevan
to the former: if you bothered to read, before SPOUTING OFF IN CAPITALS


If anything was EXTREMELY UNCLEAR it was your suggested re-working o
the Formula in the Name Refers To Box. It was very clearly documente
that it was the =SUM Formula referencing Column "M" that I required t
be replaced with a Name.

The reason for Rewriting yet again what I'd already written was in you
own words "JUST TO EXPLAIN THIS DARN THING"! If you'd only taken th
time to read the Posting.

Furthermore, If you do not have the temperament to assist in a calm an
measured manner, perhaps you should not bother!

Kind regards,
QTE said:
*QTE wrote...
Thank you for further input and insight. However, it is the
actual =SUM Formula that I wish to use a Name as opposed to
using column reference $M:

=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

OK, as-is, you could define MySumOfM as referring to

=SUM(INDIRECT("R[-9]C13:RC13",0))

If you mean for the M to be a variable, say, another defined nam
like ColLtr, which I gave in my previous response, then chage th
definition of MySumOfWhatever to

=SUM(INDIRECT(ColLtr&(ROW()-9)&":"&ColLtr&ROW()))
Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

This is where you're EXTREMELY unclear. This dynamic range isn'
necessarily the same as the range in your SUM formula. How is th
latter relevant to the former. Rewriting yet again what you'v
already writter JUST WON'T EXPLAIN A DARN THING!
 
QTE wrote...
As you can see from the quoted extract below and previously,
my dynamic range is the same as the range in my =SUM
Formula. Why is this EXTREMELY UNCLEAR? . . .

Possibly because you obviously don't understand that

INDIRECT("$M"&ROW()-9&":$M"&ROW())

is *NOT* necessarily the same range as given by

=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

Indeed, this would only ever be the case for formulas entered in cell
in row 20 (the only time when ROW()-9 == $M$9 offset +2 rows) summin
M11:M20 (since ROW()-9 to ROW() necessarily spans 10 rows, so if i
started at row 11 it'd have to end at row 20), so there would also hav
to be exactly 10 nonblank cells in all of column M.

Reread Frank Kabe's last response to one of your earlier follow-ups
"yes you can replace this with a name but not with a name definitio
like your current one. Maybe you'll try to explain whyt you're tryin
to do?"

And how did you respond to Frank's question? "I would like to use
Named Range in the Formula to make the column and formula referencin
more meaningful and transparent." Which, if it has any meaning at all
would mean that you wanted to make the column a variable. That's th
premise under which I've been operating.
You can see from the details given that the Dynamic Range and
SUM Range are the same in this instance and that the latter is
relevant to the former: if you bothered to read, before
SPOUTING OFF IN CAPITALS.

As pointed out above, only in very specific circumstances would the tw
derived ranges ever be the same. The extreme specificity of thos
circumstances led me to believe (*STILL* believe) that you're unclea
how they're related. I'll put this in simple terms: do you want th
range in a column specified elsewhere that runs from 9 rows above dow
to the row of the cell in which you'd use this formula, so

OFFSET(INDIRECT("RC1",0),-9,ColNumSpecifiedElsewhere-1,10,1)

or do you want the range from the column specified elsewhere beginnin
two rows below what's currently row 9 extending down from there by a
many cells are are nonblank in that column, so

OFFSET($A$9,2,ColNumSpecifiedElsewhere-1,
COUNTA(OFFSET(INDIRECT("$A:$A"),0,
ColNumSpecifiedElsewhere-1)),1)

??!

Your follow-ups HAVE NOT resolved this. Perhaps in your mind yo
believe they have, but you haven't exactly been showered wit
responses. Someone with a scrap of intelligence might figure tha
perhaps their own communication might just possibly be unclear t
others.
If anything was EXTREMELY UNCLEAR it was your suggested re-
working of the Formula in the Name Refers To Box. It was very
clearly documented that it was the =SUM Formula referencing
Column "M" that I required to be replaced with a Name.

If you believe this, then PRECISELY what was wrong with Frank Kabel'
original response, "why no use =SUM(Office)?" If you wanted to us
column M as you had used in your definition of Office, then this woul
work (given the extremely specific circumstances listed above).

That seems not to have been what you wanted. Several more follow-up an
responses later, you wrote:

"The current formula already starts in M11 (taking account of th
Offset) with a height of the filled cells within M:M.

Can the column reference "M" be replaced with a Name? If so, how?

Existing Formula:
=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)"

That's when Frank responded as I have previously quoted in thi
response. There's no obvious relationship between the OFFSET-generate
range in your definition of Office and the INDIRECT-generated range i
your SUM formula. They can refer to the same thing in one precise se
of circumstances as already listed. If that set of circumstances woul
always hold, then simplicity would argue for defining Office as either

=OFFSET('deptanalysis'!$A$11,0,ColNum-1,10,1)

if you specify the column (M in your examples) using its column number
or

=OFFSET('deptanalysis'!$A$11,0,COLUMN(INDIRECT(ColLtr)&"1"))-1,10,1)

if you specify the column using its column letter. Of course, you could
also define Office as either

=INDIRECT("'deptanalysis'!R[-9]C"&ColNum&":RC"&ColNum,0)

or

=INDIRECT("'deptanalysis'!"&ColLtr&(ROW()-9)&":"&ColLtr&ROW())

Then you could use the formula

=SUM(Office)

as Frank originally proposed.
The reason for Rewriting yet again what I'd already written was
in your own words "JUST TO EXPLAIN THIS DARN THING"! If
you'd only taken the time to read the Posting.

I've now read it several times through, and it's just as opaque as it
was the first time through. At some point *YOU* need to realize that
what may be clear to you is clear to *only* you.
Furthermore, If you do not have the temperament to assist in a
calm and measured manner, perhaps you should not bother!

I can respond to whatever I want. If you don't like it, tough. I enjoy
trolling for idiots, so if I piss off the occasional idiot, so much the
better. I'm not yet certain whether you qualify. Your next response
should decide the matter one way or the other.
 
QTE wrote...
As you can see from the quoted extract below and previously,
my dynamic range is the same as the range in my =SUM
Formula. Why is this EXTREMELY UNCLEAR? . . .

Possibly because you obviously don't understand that

INDIRECT("$M"&ROW()-9&":$M"&ROW())

is *NOT* necessarily the same range as given by

=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)

Indeed, this would only ever be the case for formulas entered in cell
in row 20 (the only time when ROW()-9 == $M$9 offset +2 rows) summin
M11:M20 (since ROW()-9 to ROW() necessarily spans 10 rows, so if i
started at row 11 it'd have to end at row 20), so there would also hav
to be exactly 10 nonblank cells in all of column M.

Reread Frank Kabe's last response to one of your earlier follow-ups
"yes you can replace this with a name but not with a name definitio
like your current one. Maybe you'll try to explain whyt you're tryin
to do?"

And how did you respond to Frank's question? "I would like to use
Named Range in the Formula to make the column and formula referencin
more meaningful and transparent." Which, if it has any meaning at all
would mean that you wanted to make the column a variable. That's th
premise under which I've been operating.
You can see from the details given that the Dynamic Range and
SUM Range are the same in this instance and that the latter is
relevant to the former: if you bothered to read, before
SPOUTING OFF IN CAPITALS.

As pointed out above, only in very specific circumstances would the tw
derived ranges ever be the same. The extreme specificity of thos
circumstances led me to believe (*STILL* believe) that you're unclea
how they're related. I'll put this in simple terms: do you want th
range in a column specified elsewhere that runs from 9 rows above dow
to the row of the cell in which you'd use this formula, so

OFFSET(INDIRECT("RC1",0),-9,ColNumSpecifiedElsewhere-1,10,1)

or do you want the range from the column specified elsewhere beginnin
two rows below what's currently row 9 extending down from there by a
many cells are are nonblank in that column, so

OFFSET($A$9,2,ColNumSpecifiedElsewhere-1,
COUNTA(OFFSET(INDIRECT("$A:$A"),0,
ColNumSpecifiedElsewhere-1)),1)

??!

Your follow-ups HAVE NOT resolved this. Perhaps in your mind yo
believe they have, but you haven't exactly been showered wit
responses. Someone with a scrap of intelligence might figure tha
perhaps their own communication might just possibly be unclear t
others.
If anything was EXTREMELY UNCLEAR it was your suggested re-
working of the Formula in the Name Refers To Box. It was very
clearly documented that it was the =SUM Formula referencing
Column "M" that I required to be replaced with a Name.

If you believe this, then PRECISELY what was wrong with Frank Kabel'
original response, "why no use =SUM(Office)?" If you wanted to us
column M as you had used in your definition of Office, then this woul
work (given the extremely specific circumstances listed above).

That seems not to have been what you wanted. Several more follow-up an
responses later, you wrote:

"The current formula already starts in M11 (taking account of th
Offset) with a height of the filled cells within M:M.

Can the column reference "M" be replaced with a Name? If so, how?

Existing Formula:
=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA('deptanalysis'$M:$M),1)"

That's when Frank responded as I have previously quoted in thi
response. There's no obvious relationship between the OFFSET-generate
range in your definition of Office and the INDIRECT-generated range i
your SUM formula. They can refer to the same thing in one precise se
of circumstances as already listed. If that set of circumstances woul
always hold, then simplicity would argue for defining Office as either

=OFFSET('deptanalysis'!$A$11,0,ColNum-1,10,1)

if you specify the column (M in your examples) using its column number
or

=OFFSET('deptanalysis'!$A$11,0,COLUMN(INDIRECT(ColLtr)&"1"))-1,10,1)

if you specify the column using its column letter. Of course, you could
also define Office as either

=INDIRECT("'deptanalysis'!R[-9]C"&ColNum&":RC"&ColNum,0)

or

=INDIRECT("'deptanalysis'!"&ColLtr&(ROW()-9)&":"&ColLtr&ROW())

Then you could use the formula

=SUM(Office)

as Frank originally proposed.
The reason for Rewriting yet again what I'd already written was
in your own words "JUST TO EXPLAIN THIS DARN THING"! If
you'd only taken the time to read the Posting.

I've now read it several times through, and it's just as opaque as it
was the first time through. At some point *YOU* need to realize that
what may be clear to you is clear to *only* you.
Furthermore, If you do not have the temperament to assist in a
calm and measured manner, perhaps you should not bother!

I can respond to whatever I want. If you don't like it, tough. I enjoy
trolling for idiots, so if I piss off the occasional idiot, so much the
better. I'm not yet certain whether you qualify. Your next response
should decide the matter one way or the other.
 
QTE wrote...
As you can see from the quoted extract below and
previously, my dynamic range is the same as the range in
my =SUM Formula. Why is this EXTREMELY UNCLEAR? . . .

Possibly because you obviously don't understand that

INDIRECT("$M"&ROW()-9&":$M"&ROW())

is *NOT* necessarily the same range as given by

=OFFSET('deptanalysis'!$M$9,2,0,COUNTA
('deptanalysis'$M:$M),1)

Indeed, this would only ever be the case for formulas
entered in cells in row 20 (the only time when ROW()-9 ==
$M$9 offset +2 rows) summing M11:M20 (since ROW()-9 to ROW
() necessarily spans 10 rows, so if it started at row 11
it'd have to end at row 20), so there would also have to
be exactly 10 nonblank cells in all of column M.

Reread Frank Kabe's last response to one of your earlier
follow-ups: "yes you can replace this with a name but not
with a name definition like your current one. Maybe
you'll try to explain whyt you're trying to do?"

And how did you respond to Frank's question? "I would like
to use a Named Range in the Formula to make the column and
formula referencing more meaningful and transparent."
Which, if it has any meaning at all, would mean that you
wanted to make the column a variable. That's the premise
under which I've been operating.
You can see from the details given that the Dynamic Range
and SUM Range are the same in this instance and that the
latter is relevant to the former: if you bothered to
read, before SPOUTING OFF IN CAPITALS.

As pointed out above, only in very specific circumstances
would the two derived ranges ever be the same. The extreme
specificity of those circumstances led me to believe
(*STILL* believe) that you're unclear how they're related.
I'll put this in simple terms: do you want the range in a
column specified elsewhere that runs from 9 rows above
down to the row of the cell in which you'd use this
formula, so

OFFSET(INDIRECT("RC1",0),-9,
ColNumSpecifiedElsewhere-1,10,1)

or do you want the range from the column specified
elsewhere beginning two rows below what's currently row 9
extending down from there by as many cells are are
nonblank in that column, so

OFFSET($A$9,2,ColNumSpecifiedElsewhere-1,
COUNTA(OFFSET(INDIRECT("$A:$A"),0,
ColNumSpecifiedElsewhere-1)),1)

??!

Your follow-ups HAVE NOT resolved this. Perhaps in your
mind you believe they have, but you haven't exactly been
showered with responses. Someone with a scrap of
intelligence might figure that perhaps their own
communication might just possibly be unclear to others.
If anything was EXTREMELY UNCLEAR it was your suggested
re-working of the Formula in the Name Refers To Box. It
was very clearly documented that it was the =SUM Formula
referencing Column "M" that I required to be replaced
with a Name.

If you believe this, then PRECISELY what was wrong with
Frank Kabel's original response, "why no use =SUM
(Office)?" If you wanted to use column M as you had used
in your definition of Office, then this would work (given
the extremely specific circumstances listed above).

That seems not to have been what you wanted. Several more
follow-up and responses later, you wrote:

"The current formula already starts in M11 (taking account
of the Offset) with a height of the filled cells within
M:M.

Can the column reference "M" be replaced with a Name? If
so, how?

Existing Formula:
=SUM(INDIRECT("$M"&ROW()-9&":$M"&ROW()))

Name Refers To Box:
=OFFSET('deptanalysis'!$M$9,2,0,COUNTA
('deptanalysis'$M:$M),1)"

That's when Frank responded as I have previously quoted in
this response. There's no obvious relationship between the
OFFSET-generated range in your definition of Office and
the INDIRECT-generated range in your SUM formula. They can
refer to the same thing in one precise set of
circumstances as already listed. If that set of
circumstances would always hold, then simplicity would
argue for defining Office as either

=OFFSET('deptanalysis'!$A$11,0,ColNum-1,10,1)

if you specify the column (M in your examples) using its
column number, or

=OFFSET('deptanalysis'!$A$11,0,
COLUMN(INDIRECT(ColLtr)&"1"))-1,10,1)

if you specify the column using its column letter. Of
course, you could also define Office as either

=INDIRECT("'deptanalysis'!R[-9]C"&ColNum&":RC"&ColNum,0)

or

=INDIRECT("'deptanalysis'!"&ColLtr&(ROW()-9)&":"
&ColLtr&ROW())

Then you could use the formula

=SUM(Office)

as Frank originally proposed.
The reason for Rewriting yet again what I'd already
written was in your own words "JUST TO EXPLAIN THIS DARN
THING"! If you'd only taken the time to read the Posting.

I've now read it several times through, and it's just as
opaque as it was the first time through. At some point
*YOU* need to realize that what may be clear to you is
clear to *only* you.
Furthermore, If you do not have the temperament to assist
in a calm and measured manner, perhaps you should not
bother!

I can respond to whatever I want. If you don't like it,
tough. I enjoy trolling for idiots, so if I piss off the
occasional idiot, so much the better. I'm not yet certain
whether you qualify. Your next response should decide the
matter one way or the other.
 
[...]
I've now read it several times through, and it's just as
opaque as it was the first time through. At some point
*YOU* need to realize that what may be clear to you is
clear to *only* you.

Hi Harlan
just to add something for the OP: As Harlan I would like to provide you
with a solution BUT without a more detailed explanation of WHAT you're
trying to achieve no chance for us.

To be honest after only reading the same description from you again and
again I just had given up (thankful for Harlan to step in) as I just
did not understand what you're aiming at.

So if you now take the time to test Harlan's different solutions and
respond to them why each of them is NOT sufficient and what is exactly
missing we ma get one step further

Frank

P.S.: just on a sidenote: You may try to response directly to the
relevant post and not start again on a different sub-level of this
thread
 
Back
Top