Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default SumProduct with more than 1 selection

Hi all,
I am using the following formular which works fine.

The Z... are named ranges of columns.

=SUMPRODUCT(--(Zmth="APR"),--(Zbuscode=18),--(Zinvest="A"),Zamt)

But If I want to select a number of additional selections to Zinvest in
the same column
e.g. A, B, C
I seem to be getting a problem.


Tried this which resulted in Zero.

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C"),Zamt)


Also tried this which resulted in #VALUE

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--OR(--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C")),Zamt)


Any Suggestions?
Many Thanks
TW

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default SumProduct with more than 1 selection

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--(Zinvest={"A","B","C"}),Zamt)


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ups.com...
Hi all,
I am using the following formular which works fine.

The Z... are named ranges of columns.

=SUMPRODUCT(--(Zmth="APR"),--(Zbuscode=18),--(Zinvest="A"),Zamt)

But If I want to select a number of additional selections to Zinvest in
the same column
e.g. A, B, C
I seem to be getting a problem.


Tried this which resulted in Zero.


=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--(Zinvest="A"),--(Zinvest="B"),--(Z
invest="C"),Zamt)


Also tried this which resulted in #VALUE


=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--OR(--(Zinvest="A"),--(Zinvest="B")
,--(Zinvest="C")),Zamt)


Any Suggestions?
Many Thanks
TW



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default SumProduct with more than 1 selection

TW,

In SUMPRODUCT formulas, you can use + as an analog to OR:

Your idea:

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C"),Zamt)

Could also be

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),((Zinvest="A")+(Zinvest="B")+(Zinves t="C")),Zamt)

Just an alternative to the array version, and one which I find easier to remember....

HTH,
Bernie
MS Excel MVP


wrote in message
ups.com...
Hi all,
I am using the following formular which works fine.

The Z... are named ranges of columns.

=SUMPRODUCT(--(Zmth="APR"),--(Zbuscode=18),--(Zinvest="A"),Zamt)

But If I want to select a number of additional selections to Zinvest in
the same column
e.g. A, B, C
I seem to be getting a problem.


Tried this which resulted in Zero.

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C"),Zamt)


Also tried this which resulted in #VALUE

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--OR(--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C")),Zamt)


Any Suggestions?
Many Thanks
TW



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default SumProduct with more than 1 selection

Hi all,
Thanks for the advise.

Using the array method still came up with an error message #VALUE if I
use more than one array.
But works fine for invividual letters.

So tried Bernie's method and... YES!! this works great.

Thanks again
TW



Bernie Deitrick wrote:
TW,

In SUMPRODUCT formulas, you can use + as an analog to OR:

Your idea:

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C"),Zamt)

Could also be

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),((Zinvest="A")+(Zinvest="B")+(Zinves t="C")),Zamt)

Just an alternative to the array version, and one which I find easier to remember....

HTH,
Bernie
MS Excel MVP


wrote in message
ups.com...
Hi all,
I am using the following formular which works fine.

The Z... are named ranges of columns.

=SUMPRODUCT(--(Zmth="APR"),--(Zbuscode=18),--(Zinvest="A"),Zamt)

But If I want to select a number of additional selections to Zinvest in
the same column
e.g. A, B, C
I seem to be getting a problem.


Tried this which resulted in Zero.

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C"),Zamt)


Also tried this which resulted in #VALUE

=SUMPRODUCT(--(Zmth=B2),--(Zbuscode=18),--OR(--(Zinvest="A"),--(Zinvest="B"),--(Zinvest="C")),Zamt)


Any Suggestions?
Many Thanks
TW




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
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Storing selection & using the saved selection adress later Ozgur Pars[_2_] Excel Programming 5 April 18th 06 12:01 PM
Object Type of a selection... counting rows in a selection Acid-Sky[_2_] Excel Programming 3 August 23rd 05 09:53 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


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