Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 272
Default Sumproduct using and, and or

I'm trying to add the numbers in column C, based on multiple conditions in
column A (or statement) and conditions in column B (an and statement to
column A). In the example below, I want to add the values in Column C based
on Column A equaling either X or Z, and Column B equaling NA (result would be
7)

A B C
X NA 2
X IDDD 1
Y NA 3
Y IDDD 2
Z NA 5
Z IDDD 4

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Sumproduct using and, and or

Try this:

=SUMPRODUCT((A1:A10="X")*(B1:B10="NA")*(C1:C10)) +
SUMPRODUCT((A1:A10="Z")*(B1:B10="NA")*(C1:C10))

Or, you might want to try:

=SUMPRODUCT(((A1:A10="X") + (A1:A10="Z"))*(B1:B10="NA")*(C1:C10))

which is a bit shorter.

Hope this helps.

Pete

On Jul 25, 5:00 pm, Lori wrote:
I'm trying to add the numbers in column C, based on multiple conditions in
column A (or statement) and conditions in column B (an and statement to
column A). In the example below, I want to add the values in Column C based
on Column A equaling either X or Z, and Column B equaling NA (result would be
7)

A B C
X NA 2
X IDDD 1
Y NA 3
Y IDDD 2
Z NA 5
Z IDDD 4



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Sumproduct using and, and or

=SUMPRODUCT((A2:A7={"X","Z"})*(B2:B7="NA")*(C2:C7) )

"Pete_UK" wrote:

Try this:

=SUMPRODUCT((A1:A10="X")*(B1:B10="NA")*(C1:C10)) +
SUMPRODUCT((A1:A10="Z")*(B1:B10="NA")*(C1:C10))

Or, you might want to try:

=SUMPRODUCT(((A1:A10="X") + (A1:A10="Z"))*(B1:B10="NA")*(C1:C10))

which is a bit shorter.

Hope this helps.

Pete

On Jul 25, 5:00 pm, Lori wrote:
I'm trying to add the numbers in column C, based on multiple conditions in
column A (or statement) and conditions in column B (an and statement to
column A). In the example below, I want to add the values in Column C based
on Column A equaling either X or Z, and Column B equaling NA (result would be
7)

A B C
X NA 2
X IDDD 1
Y NA 3
Y IDDD 2
Z NA 5
Z IDDD 4




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? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
sumproduct Kim Shelton at PDC Excel Discussion (Misc queries) 0 December 8th 06 09:44 PM
sumproduct RGlade Excel Discussion (Misc queries) 2 December 8th 06 09:41 PM
sumproduct RGlade Excel Worksheet Functions 3 December 8th 06 08:56 PM
sumproduct? MIchel Khennafi Excel Worksheet Functions 3 November 13th 06 11:37 PM


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