Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Sum if based on multiple conditions

I want to sum the values in AF28:AF2000 but only if the following two
conditions are met:

First, only if $H$28:$H$2000="Secure CE Lead" and second, only if
$T$28:$T$2000="True". I am using the following formula which returns 0.00 in
error.

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),AF28:AF2000)

When I apply a filter to columns H and T and filter on "Secure CE Lead" and
€śTrue€ť I can manually sum the values in AF resulting in the correct value of
430. What am I doing wrong?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Sum if based on multiple conditions

I believe this will work: (--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),--($AF$28:$AF$2000))


Dave
--
Brevity is the soul of wit.


"Dave Shultz" wrote:

I want to sum the values in AF28:AF2000 but only if the following two
conditions are met:

First, only if $H$28:$H$2000="Secure CE Lead" and second, only if
$T$28:$T$2000="True". I am using the following formula which returns 0.00 in
error.

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),AF28:AF2000)

When I apply a filter to columns H and T and filter on "Secure CE Lead" and
€śTrue€ť I can manually sum the values in AF resulting in the correct value of
430. What am I doing wrong?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Sum if based on multiple conditions

A couple of things, you can try

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000=TRUE),AF28:AF2000)

instead since "True" looks for the text whereas TRUE would be a result
of lets say =A20

If that does not work then you must have either hidden characters in
H28:H2000 like extra spaces or the values in AF28:AF2000 are text.

But I assume you have totaled them when using a filter so that doesn't
seem to be the problem


Regards,

Peo Sjoblom


Dave Shultz wrote:
I want to sum the values in AF28:AF2000 but only if the following two
conditions are met:

First, only if $H$28:$H$2000="Secure CE Lead" and second, only if
$T$28:$T$2000="True". I am using the following formula which returns 0.00 in
error.

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),AF28:AF2000)

When I apply a filter to columns H and T and filter on "Secure CE Lead" and
€śTrue€ť I can manually sum the values in AF resulting in the correct value of
430. What am I doing wrong?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Sum if based on multiple conditions

Good catch. The result of column T is not text as I assumed. I changed
€śTrue€ť to TRUE and it worked. Thanks for your help.

One of the other responders suggested {=SUM(IF($H$28:$H$2000="Secure CE
Lead",IF($T$28:$T$2000=TRUE,AF28:AF2000,0),0))} which also works just fine.
Is there any advantage either way?


"Peo Sjoblom" wrote:

A couple of things, you can try

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000=TRUE),AF28:AF2000)

instead since "True" looks for the text whereas TRUE would be a result
of lets say =A20

If that does not work then you must have either hidden characters in
H28:H2000 like extra spaces or the values in AF28:AF2000 are text.

But I assume you have totaled them when using a filter so that doesn't
seem to be the problem


Regards,

Peo Sjoblom


Dave Shultz wrote:
I want to sum the values in AF28:AF2000 but only if the following two
conditions are met:

First, only if $H$28:$H$2000="Secure CE Lead" and second, only if
$T$28:$T$2000="True". I am using the following formula which returns 0.00 in
error.

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),AF28:AF2000)

When I apply a filter to columns H and T and filter on "Secure CE Lead" and
€śTrue€ť I can manually sum the values in AF resulting in the correct value of
430. What am I doing wrong?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Sum if based on multiple conditions

SUMPRODUCT is a tad faster.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Dave Shultz" wrote in message
...
Good catch. The result of column T is not text as I assumed. I changed
"True" to TRUE and it worked. Thanks for your help.

One of the other responders suggested {=SUM(IF($H$28:$H$2000="Secure CE
Lead",IF($T$28:$T$2000=TRUE,AF28:AF2000,0),0))} which also works just
fine.
Is there any advantage either way?


"Peo Sjoblom" wrote:

A couple of things, you can try

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000=TRUE),AF28:AF2000)

instead since "True" looks for the text whereas TRUE would be a result
of lets say =A20

If that does not work then you must have either hidden characters in
H28:H2000 like extra spaces or the values in AF28:AF2000 are text.

But I assume you have totaled them when using a filter so that doesn't
seem to be the problem


Regards,

Peo Sjoblom


Dave Shultz wrote:
I want to sum the values in AF28:AF2000 but only if the following two
conditions are met:

First, only if $H$28:$H$2000="Secure CE Lead" and second, only if
$T$28:$T$2000="True". I am using the following formula which returns
0.00 in
error.

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),AF28:AF2000)

When I apply a filter to columns H and T and filter on "Secure CE Lead"
and
"True" I can manually sum the values in AF resulting in the correct
value of
430. What am I doing wrong?






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 252
Default Sum if based on multiple conditions

FYI if the array contains boolean values (TRUE or FALSE), then you don't need
"=TRUE" part. You can use this...

=SUMPRODUCT(--($H$28:$H$2000="Secure CE Lead"),--($T$28:$T$2000),AF28:AF2000)

"Dave Shultz" wrote:

Good catch. The result of column T is not text as I assumed. I changed
€śTrue€ť to TRUE and it worked. Thanks for your help.

One of the other responders suggested {=SUM(IF($H$28:$H$2000="Secure CE
Lead",IF($T$28:$T$2000=TRUE,AF28:AF2000,0),0))} which also works just fine.
Is there any advantage either way?


"Peo Sjoblom" wrote:

A couple of things, you can try

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000=TRUE),AF28:AF2000)

instead since "True" looks for the text whereas TRUE would be a result
of lets say =A20

If that does not work then you must have either hidden characters in
H28:H2000 like extra spaces or the values in AF28:AF2000 are text.

But I assume you have totaled them when using a filter so that doesn't
seem to be the problem


Regards,

Peo Sjoblom


Dave Shultz wrote:
I want to sum the values in AF28:AF2000 but only if the following two
conditions are met:

First, only if $H$28:$H$2000="Secure CE Lead" and second, only if
$T$28:$T$2000="True". I am using the following formula which returns 0.00 in
error.

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),AF28:AF2000)

When I apply a filter to columns H and T and filter on "Secure CE Lead" and
€śTrue€ť I can manually sum the values in AF resulting in the correct value of
430. What am I doing wrong?


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Sum if based on multiple conditions

Dave,

A couple of possibilities.

First, if you want a sum, you should use the SUM function, not the
SUMPRODUCT function.

Second, the conditions need to be written using the "IF" function. You need
to add something for the "FALSE" outcome of each "IF". Since you are doing
a SUM, I suggest "0" as the "FALSE" result.

Third, I'm not sure what the "--" in front of the two conditions does for
you. I don't think they should be there.

Finally, be sure that you use <CTRL<SHIFT<ENTER (all pressed at the same
time) to enter the formula as an array formula rather than a standard
formula.

The formula should be:

=SUM(IF($H$28:$H$2000="Secure CE
Lead",If($T$28:$T$2000="True",AF28:AF2000,0),0))

Good luck!

David


"Dave Shultz" <Dave wrote in message
...
I want to sum the values in AF28:AF2000 but only if the following two
conditions are met:

First, only if $H$28:$H$2000="Secure CE Lead" and second, only if
$T$28:$T$2000="True". I am using the following formula which returns 0.00

in
error.

=SUMPRODUCT(--($H$28:$H$2000="Secure CE
Lead"),--($T$28:$T$2000="True"),AF28:AF2000)

When I apply a filter to columns H and T and filter on "Secure CE Lead"

and
"True" I can manually sum the values in AF resulting in the correct value

of
430. What am I doing wrong?



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
Count text based on multiple (2) conditions Leathal711 Excel Worksheet Functions 4 September 27th 06 03:49 AM
How do I return a value based on multiple possible conditions? nevermore627 Excel Worksheet Functions 4 July 21st 06 01:14 AM
HELP| populate cell with particular value based on multiple condit doon Excel Worksheet Functions 7 February 13th 06 11:26 PM
COUNT using multiple conditions SamGB Excel Discussion (Misc queries) 2 February 9th 06 10:12 PM
Sum If Multiple Conditions JulieD Excel Worksheet Functions 0 January 25th 05 02:02 PM


All times are GMT +1. The time now is 11:09 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"