PC Review


Reply
Thread Tools Rate Thread

Changing the Sum Range

 
 
=?Utf-8?B?bWNsZWVzdGVy?=
Guest
Posts: n/a
 
      31st Aug 2007
I have an "array formula" that uses multiple criteria to do mimic a "SUMIF"
with more than one possible criteria.

Essentially it is {SUM(IF((C3:C15<>"X")*(C3:C15<>"Y"),1,0)*(D315))}

I want to change the sum range (that is, the (D315)) dependent on some
variable. That is, sometimes I want it to use E3:E15 or K3:K15. Is there an
easy way to do this?

Thanks!
 
Reply With Quote
 
 
 
 
Rodrigo Ferreira
Guest
Posts: n/a
 
      31st Aug 2007
Try something like this

SUMPRODUCT( (C3:C15<>"X")* (C3:C15<>"Y"), OFFSET(C3;;D1;13))

where 13 is the number of cells you want to sum

where D1 is the number of the column (after C) you want to sum.
eg.:
if D1 = 1, will sum D315
if D1 = 8, will sum K3:K15


If you want everything in variables, try this:

SUMPRODUCT( (OFFSET(C3;;C1;13)<>"X")* (OFFSET(C3;;C1;13)<>"Y"),
OFFSET(C3;;D1;13))
where C1 is the number of the column (after C) you want to compare.
eg.:
if C1 = 0, will check C3:C15
if C1 = 2, will check E3:E15

--

Rodrigo Ferreira
Regards from Brazil


"mcleester" <(E-Mail Removed)> escreveu na mensagem
news:94B4D457-7F93-4823-B620-(E-Mail Removed)...
>I have an "array formula" that uses multiple criteria to do mimic a "SUMIF"
> with more than one possible criteria.
>
> Essentially it is {SUM(IF((C3:C15<>"X")*(C3:C15<>"Y"),1,0)*(D315))}
>
> I want to change the sum range (that is, the (D315)) dependent on some
> variable. That is, sometimes I want it to use E3:E15 or K3:K15. Is there
> an
> easy way to do this?
>
> Thanks!



 
Reply With Quote
 
Bruno Campanini
Guest
Posts: n/a
 
      31st Aug 2007
"mcleester" <(E-Mail Removed)> wrote in message
news:94B4D457-7F93-4823-B620-(E-Mail Removed)...
>I have an "array formula" that uses multiple criteria to do mimic a "SUMIF"
> with more than one possible criteria.
>
> Essentially it is {SUM(IF((C3:C15<>"X")*(C3:C15<>"Y"),1,0)*(D315))}
>
> I want to change the sum range (that is, the (D315)) dependent on some
> variable. That is, sometimes I want it to use E3:E15 or K3:K15. Is there
> an
> easy way to do this?


{=SUM((C3:C15<>"X")*(C3:C15<>"Y")*(D315))}
FormulaArray

{=SUM((C3:C15<>"X")*(C3:C15<>"Y")*INDIRECT(B3&"3:"&B3&"15"))}
FormulaArray, having in B3: D | E | K | ...

Bruno

 
Reply With Quote
 
Bruno Campanini
Guest
Posts: n/a
 
      31st Aug 2007
"Bruno Campanini" <(E-Mail Removed)> wrote in message
news:uwZFLe$(E-Mail Removed)...

> {=SUM((C3:C15<>"X")*(C3:C15<>"Y")*(D315))}
> FormulaArray
>
> {=SUM((C3:C15<>"X")*(C3:C15<>"Y")*INDIRECT(B3&"3:"&B3&"15"))}
> FormulaArray, having in B3: D | E | K | ...
>
> Bruno


You can avoid FormulaArray mode replacing SUM with
SUMPRODUCT.

Bruno

 
Reply With Quote
 
=?Utf-8?B?bWNsZWVzdGVy?=
Guest
Posts: n/a
 
      31st Aug 2007
That works great! Muito obrigado.

"Rodrigo Ferreira" wrote:

> Try something like this
>
> SUMPRODUCT( (C3:C15<>"X")* (C3:C15<>"Y"), OFFSET(C3;;D1;13))
>
> where 13 is the number of cells you want to sum
>
> where D1 is the number of the column (after C) you want to sum.
> eg.:
> if D1 = 1, will sum D315
> if D1 = 8, will sum K3:K15
>
>
> If you want everything in variables, try this:
>
> SUMPRODUCT( (OFFSET(C3;;C1;13)<>"X")* (OFFSET(C3;;C1;13)<>"Y"),
> OFFSET(C3;;D1;13))
> where C1 is the number of the column (after C) you want to compare.
> eg.:
> if C1 = 0, will check C3:C15
> if C1 = 2, will check E3:E15
>
> --
>
> Rodrigo Ferreira
> Regards from Brazil
>
>
> "mcleester" <(E-Mail Removed)> escreveu na mensagem
> news:94B4D457-7F93-4823-B620-(E-Mail Removed)...
> >I have an "array formula" that uses multiple criteria to do mimic a "SUMIF"
> > with more than one possible criteria.
> >
> > Essentially it is {SUM(IF((C3:C15<>"X")*(C3:C15<>"Y"),1,0)*(D315))}
> >
> > I want to change the sum range (that is, the (D315)) dependent on some
> > variable. That is, sometimes I want it to use E3:E15 or K3:K15. Is there
> > an
> > easy way to do this?
> >
> > Thanks!

>
>
>

 
Reply With Quote
 
=?Utf-8?B?bWNsZWVzdGVy?=
Guest
Posts: n/a
 
      31st Aug 2007
Thanks for the info! That indirect function will definitely come in handy.

"Bruno Campanini" wrote:

> "Bruno Campanini" <(E-Mail Removed)> wrote in message
> news:uwZFLe$(E-Mail Removed)...
>
> > {=SUM((C3:C15<>"X")*(C3:C15<>"Y")*(D315))}
> > FormulaArray
> >
> > {=SUM((C3:C15<>"X")*(C3:C15<>"Y")*INDIRECT(B3&"3:"&B3&"15"))}
> > FormulaArray, having in B3: D | E | K | ...
> >
> > Bruno

>
> You can avoid FormulaArray mode replacing SUM with
> SUMPRODUCT.
>
> Bruno
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the range for averages with out changing the formula. JessLRC Microsoft Excel Worksheet Functions 0 20th Apr 2010 03:10 PM
Autofill 1 column with changing data and changing range cdclayton Microsoft Excel Programming 0 5th Aug 2008 04:37 PM
How do I prevent a formula range from changing when Iinsert a column within said range? George Microsoft Excel Discussion 4 5th Mar 2007 06:46 PM
Changing the ECP I/O Range for HP All-in-One =?Utf-8?B?QWxhbg==?= Windows XP Print / Fax 6 7th Aug 2006 08:35 AM
range changing RichardO Microsoft Excel Misc 0 7th Jun 2004 12:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:23 AM.