Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 183
Default SumProduct with optional conditions

Hello,
I would like to be able to sum numbers in column I based on conditions in
A,B,C . The formula below works
=SUMPRODUCT(($A$112:$A$1155=$A$14)*($C$112:$C$1155 =$C$14)*($B$112:$B$1155=$B$14)*(I$112:I$1155))
Now I would like to make the condition in each column optional, so i can use
the same formula if I want to sum column I only conditions in A and B for
instance (ignoring C)
Something like if($A$13=true,($A$112:$A$1155=$A$14), etc
How can I combine this in one elegant formula?
Any help is appreciated.thanks
--
caroline
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default SumProduct with optional conditions

Well, you need some way to indicate which sections you want to include. I
used cells A13, B13, C13. These cells I am using will have a value of 1 or 0.
A 1 indicates you WANT to include this criteria, and a 0 means you want to
EXCLUDE this criteria. NOTE: If you exclude all criteria (A13,B13,and C13 are
all 0), it will error.

Otherwise, use the following formula, which is an array** formula (after
typing formula, press CTRL+Shift+Enter to commit the formula to the cell).

=SUMPRODUCT((IF($A$13=0,1,$A$112:$A$1155=$A$14))*( IF($B$13=0,1,$B$112:$B$1155=$B$14))*(IF($C$13=0,1, $C$112:$C$1155=$C$14)),(I$112:I$1155))

Hope this helps.
--
John C


"caroline" wrote:

Hello,
I would like to be able to sum numbers in column I based on conditions in
A,B,C . The formula below works
=SUMPRODUCT(($A$112:$A$1155=$A$14)*($C$112:$C$1155 =$C$14)*($B$112:$B$1155=$B$14)*(I$112:I$1155))
Now I would like to make the condition in each column optional, so i can use
the same formula if I want to sum column I only conditions in A and B for
instance (ignoring C)
Something like if($A$13=true,($A$112:$A$1155=$A$14), etc
How can I combine this in one elegant formula?
Any help is appreciated.thanks
--
caroline

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 183
Default SumProduct with optional conditions

Thanks it worked with the Array formula
--
caroline


"John C" wrote:

Well, you need some way to indicate which sections you want to include. I
used cells A13, B13, C13. These cells I am using will have a value of 1 or 0.
A 1 indicates you WANT to include this criteria, and a 0 means you want to
EXCLUDE this criteria. NOTE: If you exclude all criteria (A13,B13,and C13 are
all 0), it will error.

Otherwise, use the following formula, which is an array** formula (after
typing formula, press CTRL+Shift+Enter to commit the formula to the cell).

=SUMPRODUCT((IF($A$13=0,1,$A$112:$A$1155=$A$14))*( IF($B$13=0,1,$B$112:$B$1155=$B$14))*(IF($C$13=0,1, $C$112:$C$1155=$C$14)),(I$112:I$1155))

Hope this helps.
--
John C


"caroline" wrote:

Hello,
I would like to be able to sum numbers in column I based on conditions in
A,B,C . The formula below works
=SUMPRODUCT(($A$112:$A$1155=$A$14)*($C$112:$C$1155 =$C$14)*($B$112:$B$1155=$B$14)*(I$112:I$1155))
Now I would like to make the condition in each column optional, so i can use
the same formula if I want to sum column I only conditions in A and B for
instance (ignoring C)
Something like if($A$13=true,($A$112:$A$1155=$A$14), etc
How can I combine this in one elegant formula?
Any help is appreciated.thanks
--
caroline

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
Sumproduct with conditions JDB Excel Discussion (Misc queries) 2 March 15th 07 11:40 AM
SUMPRODUCT with conditions sahafi Excel Worksheet Functions 3 November 30th 06 10:32 PM
Conditions in sumproduct Antonio Excel Worksheet Functions 3 October 26th 06 03:18 AM
sumproduct three conditions Scire Excel Worksheet Functions 3 May 9th 06 06:22 PM
Sumproduct Multiple Conditions Tysone Excel Worksheet Functions 3 November 10th 04 03:03 PM


All times are GMT +1. The time now is 01:39 AM.

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"