Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default SUMIF with multiple columns in sum range

I have an array that I need to sum multiple columns depending of the value in
Col D.
The ws containing the array is called 'data'. I must sum cols F,J,N,R,V,Z in
rows 7-25. On another ws my formula is:
=SUMIF(Data!$D$7:$D$25,$A4,Data!$F$7:$F$25)
Of course this only gives me the sum of Col F. Is there a way to put the sum
range in one formula? I want to avoid stringing a bunch of SUMIFs together.

Thanks,
Joe M
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default SUMIF with multiple columns in sum range

One way...

Assumes no TEXT entries in cols F,J,N,R,V,Z.

=SUMPRODUCT(--($D$7:$D$25=$A4),$F$7:$F$25+$J$7:$J$25+$N$7:$N$25+ $R$7:$R$25+$V$7:$V$25+$Z$7:$Z$25)

--
Biff
Microsoft Excel MVP


"Joe M." wrote in message
...
I have an array that I need to sum multiple columns depending of the value
in
Col D.
The ws containing the array is called 'data'. I must sum cols F,J,N,R,V,Z
in
rows 7-25. On another ws my formula is:
=SUMIF(Data!$D$7:$D$25,$A4,Data!$F$7:$F$25)
Of course this only gives me the sum of Col F. Is there a way to put the
sum
range in one formula? I want to avoid stringing a bunch of SUMIFs
together.

Thanks,
Joe M



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default SUMIF with multiple columns in sum range

This works. I tried to make it shorter using named ranges in the formula but
I get a #VALUE error. My named range is called Data_Sel_WA. My formula is now:
=SUMPRODUCT(--(Data_Selection!$D$7:$D$25=$A10),Data_Sel_WA)
My named range is defined as:
=Data_Selection!$F$7:$F$25,Data_Selection!$J$7:$J$ 25,Data_Selection!$N$7:$N$25,Data_Selection!$R$7:$ R$25,Data_Selection!$V$7:$V$25,Data_Selection!$Z$7 :$Z$25,Data_Selection!$AD$7:$AD$25

Did I do something wrong or will named ranges not work with SUMPRODUCT?

Thanks,
Joe M.

"T. Valko" wrote:

One way...

Assumes no TEXT entries in cols F,J,N,R,V,Z.

=SUMPRODUCT(--($D$7:$D$25=$A4),$F$7:$F$25+$J$7:$J$25+$N$7:$N$25+ $R$7:$R$25+$V$7:$V$25+$Z$7:$Z$25)

--
Biff
Microsoft Excel MVP


"Joe M." wrote in message
...
I have an array that I need to sum multiple columns depending of the value
in
Col D.
The ws containing the array is called 'data'. I must sum cols F,J,N,R,V,Z
in
rows 7-25. On another ws my formula is:
=SUMIF(Data!$D$7:$D$25,$A4,Data!$F$7:$F$25)
Of course this only gives me the sum of Col F. Is there a way to put the
sum
range in one formula? I want to avoid stringing a bunch of SUMIFs
together.

Thanks,
Joe M



.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default SUMIF with multiple columns in sum range

In this application, each of these:

=Data_Selection!$F$7:$F$25,Data_Selection!$J$7:$J $25,Data_Selection!$N$7:$N$25,Data_Selection!$R$7: $R$25,Data_Selection!$V$7:$V$25,Data_Selection!$Z$ 7:$Z$25,Data_Selection!$AD$7:$AD$25


Needs to be a *separate* range.

You can use this array formula** where the range is a single contiguous
range but only the specific columns in that range will be calculated:

=SUM(IF(Selection!D7:D25=A10,IF(MOD(COLUMN(Selecti on!F7:AD25)-COLUMN(Selection!F7),4)=0,Selection!F7:AD25)))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Joe M." wrote in message
...
This works. I tried to make it shorter using named ranges in the formula
but
I get a #VALUE error. My named range is called Data_Sel_WA. My formula is
now:
=SUMPRODUCT(--(Data_Selection!$D$7:$D$25=$A10),Data_Sel_WA)
My named range is defined as:
=Data_Selection!$F$7:$F$25,Data_Selection!$J$7:$J$ 25,Data_Selection!$N$7:$N$25,Data_Selection!$R$7:$ R$25,Data_Selection!$V$7:$V$25,Data_Selection!$Z$7 :$Z$25,Data_Selection!$AD$7:$AD$25

Did I do something wrong or will named ranges not work with SUMPRODUCT?

Thanks,
Joe M.

"T. Valko" wrote:

One way...

Assumes no TEXT entries in cols F,J,N,R,V,Z.

=SUMPRODUCT(--($D$7:$D$25=$A4),$F$7:$F$25+$J$7:$J$25+$N$7:$N$25+ $R$7:$R$25+$V$7:$V$25+$Z$7:$Z$25)

--
Biff
Microsoft Excel MVP


"Joe M." wrote in message
...
I have an array that I need to sum multiple columns depending of the
value
in
Col D.
The ws containing the array is called 'data'. I must sum cols
F,J,N,R,V,Z
in
rows 7-25. On another ws my formula is:
=SUMIF(Data!$D$7:$D$25,$A4,Data!$F$7:$F$25)
Of course this only gives me the sum of Col F. Is there a way to put
the
sum
range in one formula? I want to avoid stringing a bunch of SUMIFs
together.

Thanks,
Joe M



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUMIF-with 2 conditions, need to add range in 2 columns nursemlb Excel Worksheet Functions 3 October 21st 08 03:25 AM
Sumif Multiple Columns [email protected] Excel Worksheet Functions 2 December 17th 07 08:40 PM
want sumif function's range to evaluate 2 columns Debgala Excel Worksheet Functions 7 November 6th 05 03:46 AM
SUMIF using two columns in both Range and Criteria Gordon Excel Discussion (Misc queries) 5 June 29th 05 06:56 PM
SUMIF using two columns in both Range and Criteria Gordon Excel Worksheet Functions 5 June 29th 05 06:56 PM


All times are GMT +1. The time now is 03:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"