Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Todd
 
Posts: n/a
Default conditional sum formula

I have a list of numbers to add if they meet two criteria and I have been
trying to use the conditional sum feature in excel.

Column A is a list from 1 to 5 and I want to sum all the numbers in column B
if Column A is either a 1 or a 5.

Below is the array formula the conditional sum feature produces and it
returns 0 when it should return 11. The array works if there is only one
variable but not multiple.

Can someone tell me why its not working?

Thank you.

{=SUM(IF($A$3:$A$10=5,IF($A$3:$A$10=1,$A$3:$A$10,0 ),0))}

2 2
5 5
2 2
1 2
5 5
1 2
2 2
1 2
2 2



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Todd
 
Posts: n/a
Default conditional sum formula

Oops, I see my formula adds column A when it should be column B. My mistake!
But the problem is the same. The formula doesn't handle multiple criteria.
It came out of the conditional sum add in from excel so I don't understand
why it wouldn't. But I am willing to get over that and just write the
formula myself. :) (if I knew how)

"Todd" wrote:

I have a list of numbers to add if they meet two criteria and I have been
trying to use the conditional sum feature in excel.

Column A is a list from 1 to 5 and I want to sum all the numbers in column B
if Column A is either a 1 or a 5.

Below is the array formula the conditional sum feature produces and it
returns 0 when it should return 11. The array works if there is only one
variable but not multiple.

Can someone tell me why its not working?

Thank you.

{=SUM(IF($A$3:$A$10=5,IF($A$3:$A$10=1,$A$3:$A$10,0 ),0))}

2 2
5 5
2 2
1 2
5 5
1 2
2 2
1 2
2 2



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default conditional sum formula

=SUMPRODUCT(--(ISNUMBER(MATCH(A1:A10,{1,5},0))),B1:B10)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd" wrote in message
...
I have a list of numbers to add if they meet two criteria and I have been
trying to use the conditional sum feature in excel.

Column A is a list from 1 to 5 and I want to sum all the numbers in column

B
if Column A is either a 1 or a 5.

Below is the array formula the conditional sum feature produces and it
returns 0 when it should return 11. The array works if there is only one
variable but not multiple.

Can someone tell me why its not working?

Thank you.

{=SUM(IF($A$3:$A$10=5,IF($A$3:$A$10=1,$A$3:$A$10,0 ),0))}

2 2
5 5
2 2
1 2
5 5
1 2
2 2
1 2
2 2





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default conditional sum formula

=SUMPRODUCT(($A$3:$A$10=5)+($A$3:$A$10=1),$B$3:$B$ 10)

This should do it.

HTH
--
AP


"Todd" a écrit dans le message de
...
Oops, I see my formula adds column A when it should be column B. My

mistake!
But the problem is the same. The formula doesn't handle multiple

criteria.
It came out of the conditional sum add in from excel so I don't understand
why it wouldn't. But I am willing to get over that and just write the
formula myself. :) (if I knew how)

"Todd" wrote:

I have a list of numbers to add if they meet two criteria and I have

been
trying to use the conditional sum feature in excel.

Column A is a list from 1 to 5 and I want to sum all the numbers in

column B
if Column A is either a 1 or a 5.

Below is the array formula the conditional sum feature produces and it
returns 0 when it should return 11. The array works if there is only one
variable but not multiple.

Can someone tell me why its not working?

Thank you.

{=SUM(IF($A$3:$A$10=5,IF($A$3:$A$10=1,$A$3:$A$10,0 ),0))}

2 2
5 5
2 2
1 2
5 5
1 2
2 2
1 2
2 2





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
Conditional Sum Formula? Boulder257 Excel Discussion (Misc queries) 1 January 25th 06 05:06 PM
need a conditional formula to generate numbers divisible by 4 between a given starting no. & end No. ramana Excel Worksheet Functions 5 October 21st 05 07:39 AM
Conditional formatting...cont. from 9/25 Guenzak Excel Discussion (Misc queries) 4 September 26th 05 10:55 PM
Conditional Formatting formula not acceptable? Thief_ Excel Discussion (Misc queries) 4 July 19th 05 11:54 AM
Formula Dependant Conditional Formatting LDanix Excel Discussion (Misc queries) 1 January 13th 05 06:50 PM


All times are GMT +1. The time now is 05:21 AM.

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

About Us

"It's about Microsoft Excel"