#1   Report Post  
Posted to microsoft.public.excel.misc
Kay Kay is offline
external usenet poster
 
Posts: 129
Default SUMPRODUCT Formula

Hi!
I am using sumproduct formula
for example i want to look for Q1 in column A and then sum the value of
Column E for value Q1
=sumproduct(--("Q1"=A2:A100),E2:E100)

My question is that How can i give multiple selection
For eg in above formula
i want to look for q1,q2 and q3
something like
=sumproduct(--("Q1,Q2,Q3"=A2:A100,E2:E100)
OR
=sumproduct(--("Z2:Z4"=A2:A100,E2:E100)

I select Q1,Q2and Q3 from the dropdown list.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default SUMPRODUCT Formula

=SUMPRODUCT((A2:A100={"Q1","Q2","Q3"})*(E2:E100))

--
__________________________________
HTH

Bob

"kay" wrote in message
...
Hi!
I am using sumproduct formula
for example i want to look for Q1 in column A and then sum the value of
Column E for value Q1
=sumproduct(--("Q1"=A2:A100),E2:E100)

My question is that How can i give multiple selection
For eg in above formula
i want to look for q1,q2 and q3
something like
=sumproduct(--("Q1,Q2,Q3"=A2:A100,E2:E100)
OR
=sumproduct(--("Z2:Z4"=A2:A100,E2:E100)

I select Q1,Q2and Q3 from the dropdown list.

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default SUMPRODUCT Formula

kay,

=SUMPRODUCT((ISNUMBER(FIND(A2:A100,"Q1Q2Q3")))*E2: E100)

HTH,
Bernie
MS Excel MVP


"kay" wrote in message
...
Hi!
I am using sumproduct formula
for example i want to look for Q1 in column A and then sum the value of
Column E for value Q1
=sumproduct(--("Q1"=A2:A100),E2:E100)

My question is that How can i give multiple selection
For eg in above formula
i want to look for q1,q2 and q3
something like
=sumproduct(--("Q1,Q2,Q3"=A2:A100,E2:E100)
OR
=sumproduct(--("Z2:Z4"=A2:A100,E2:E100)

I select Q1,Q2and Q3 from the dropdown list.

Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.misc
Kay Kay is offline
external usenet poster
 
Posts: 129
Default SUMPRODUCT Formula

Thank you so much Bernie and Bob

"Bernie Deitrick" wrote:

kay,

=SUMPRODUCT((ISNUMBER(FIND(A2:A100,"Q1Q2Q3")))*E2: E100)

HTH,
Bernie
MS Excel MVP


"kay" wrote in message
...
Hi!
I am using sumproduct formula
for example i want to look for Q1 in column A and then sum the value of
Column E for value Q1
=sumproduct(--("Q1"=A2:A100),E2:E100)

My question is that How can i give multiple selection
For eg in above formula
i want to look for q1,q2 and q3
something like
=sumproduct(--("Q1,Q2,Q3"=A2:A100,E2:E100)
OR
=sumproduct(--("Z2:Z4"=A2:A100,E2:E100)

I select Q1,Q2and Q3 from the dropdown list.

Thanks!




  #5   Report Post  
Posted to microsoft.public.excel.misc
Kay Kay is offline
external usenet poster
 
Posts: 129
Default SUMPRODUCT Formula

when i tried for sample number it works
but I have this formula which i am using
=IF($C$11="ALL",SUMPRODUCT(--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370),SUMPRODUCT (--($C$11=SH2!C2:C30370),--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370)


so what it does if c11 = All, then it sums the value else if c11 = Product1
then look product1 in sh2 from C2 to C30370

so if C11 = Product1,Product2 and when i use your solution it does not
work - gives error, may be i am missing some thing

any help?

Thanks!


"Bernie Deitrick" wrote:

kay,

=SUMPRODUCT((ISNUMBER(FIND(A2:A100,"Q1Q2Q3")))*E2: E100)

HTH,
Bernie
MS Excel MVP


"kay" wrote in message
...
Hi!
I am using sumproduct formula
for example i want to look for Q1 in column A and then sum the value of
Column E for value Q1
=sumproduct(--("Q1"=A2:A100),E2:E100)

My question is that How can i give multiple selection
For eg in above formula
i want to look for q1,q2 and q3
something like
=sumproduct(--("Q1,Q2,Q3"=A2:A100,E2:E100)
OR
=sumproduct(--("Z2:Z4"=A2:A100,E2:E100)

I select Q1,Q2and Q3 from the dropdown list.

Thanks!






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default SUMPRODUCT Formula

Kay,

Your formula works fine for me.

What I like to do is test the formula by parts: enter the first sumproduct formula by itself

=SUMPRODUCT(--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370)

and then reduce the range to a workbable number of cells, say through row 10

=SUMPRODUCT(--($C$12=SH2!AK2:AK10),--("Q2"=SH2!AL2:AL10),--($C$15<=SH2!AP2:AP10),--($D$15=SH2!AP2:AP10),SH2!O2:O10)

and put values into those 9 rows that will give you some result that you expect.

Then select each subpart, such as this

--($C$12=SH2!AK2:AK10)

and then press F9 to calculate that part - you will get something like this for each of those --

{0;1;1;1;1;1;1;1;1}

If you don't get 0 or 1 values, then you may have errors in your formula...

Do that for each part, and then take this

{0;1;1;1;1;1;1;1;1}, {0;1;1;1;1;1;1;1;1}

and change the separating comma to a *

{0;1;1;1;1;1;1;1;1}*{0;1;1;1;1;1;1;1;1}

and select all that and press F9 to calc that subsection.

HTH,
Bernie
MS Excel MVP


"kay" wrote in message
...
when i tried for sample number it works
but I have this formula which i am using
=IF($C$11="ALL",SUMPRODUCT(--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370),SUMPRODUCT (--($C$11=SH2!C2:C30370),--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370)


so what it does if c11 = All, then it sums the value else if c11 = Product1
then look product1 in sh2 from C2 to C30370

so if C11 = Product1,Product2 and when i use your solution it does not
work - gives error, may be i am missing some thing

any help?

Thanks!


"Bernie Deitrick" wrote:

kay,

=SUMPRODUCT((ISNUMBER(FIND(A2:A100,"Q1Q2Q3")))*E2: E100)

HTH,
Bernie
MS Excel MVP


"kay" wrote in message
...
Hi!
I am using sumproduct formula
for example i want to look for Q1 in column A and then sum the value of
Column E for value Q1
=sumproduct(--("Q1"=A2:A100),E2:E100)

My question is that How can i give multiple selection
For eg in above formula
i want to look for q1,q2 and q3
something like
=sumproduct(--("Q1,Q2,Q3"=A2:A100,E2:E100)
OR
=sumproduct(--("Z2:Z4"=A2:A100,E2:E100)

I select Q1,Q2and Q3 from the dropdown list.

Thanks!






  #7   Report Post  
Posted to microsoft.public.excel.misc
Kay Kay is offline
external usenet poster
 
Posts: 129
Default SUMPRODUCT Formula

ok finally it is working.
Thanks , i really appreciate your help.

"Bernie Deitrick" wrote:

Kay,

Your formula works fine for me.

What I like to do is test the formula by parts: enter the first sumproduct formula by itself

=SUMPRODUCT(--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370)

and then reduce the range to a workbable number of cells, say through row 10

=SUMPRODUCT(--($C$12=SH2!AK2:AK10),--("Q2"=SH2!AL2:AL10),--($C$15<=SH2!AP2:AP10),--($D$15=SH2!AP2:AP10),SH2!O2:O10)

and put values into those 9 rows that will give you some result that you expect.

Then select each subpart, such as this

--($C$12=SH2!AK2:AK10)

and then press F9 to calculate that part - you will get something like this for each of those --

{0;1;1;1;1;1;1;1;1}

If you don't get 0 or 1 values, then you may have errors in your formula...

Do that for each part, and then take this

{0;1;1;1;1;1;1;1;1}, {0;1;1;1;1;1;1;1;1}

and change the separating comma to a *

{0;1;1;1;1;1;1;1;1}*{0;1;1;1;1;1;1;1;1}

and select all that and press F9 to calc that subsection.

HTH,
Bernie
MS Excel MVP


"kay" wrote in message
...
when i tried for sample number it works
but I have this formula which i am using
=IF($C$11="ALL",SUMPRODUCT(--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370),SUMPRODUCT (--($C$11=SH2!C2:C30370),--($C$12=SH2!AK2:AK30370),--("Q2"=SH2!AL2:AL30370),--($C$15<=SH2!AP2:AP30370),--($D$15=SH2!AP2:AP30370),SH2!O2:O30370)


so what it does if c11 = All, then it sums the value else if c11 = Product1
then look product1 in sh2 from C2 to C30370

so if C11 = Product1,Product2 and when i use your solution it does not
work - gives error, may be i am missing some thing

any help?

Thanks!


"Bernie Deitrick" wrote:

kay,

=SUMPRODUCT((ISNUMBER(FIND(A2:A100,"Q1Q2Q3")))*E2: E100)

HTH,
Bernie
MS Excel MVP


"kay" wrote in message
...
Hi!
I am using sumproduct formula
for example i want to look for Q1 in column A and then sum the value of
Column E for value Q1
=sumproduct(--("Q1"=A2:A100),E2:E100)

My question is that How can i give multiple selection
For eg in above formula
i want to look for q1,q2 and q3
something like
=sumproduct(--("Q1,Q2,Q3"=A2:A100,E2:E100)
OR
=sumproduct(--("Z2:Z4"=A2:A100,E2:E100)

I select Q1,Q2and Q3 from the dropdown list.

Thanks!






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
Nesting a sumproduct formula within a sumif formula. jerrymcm Excel Discussion (Misc queries) 2 October 3rd 07 03:35 PM
sumproduct formula Stacey Excel Discussion (Misc queries) 6 March 29th 07 11:38 PM
SUMPRODUCT Formula Dan Excel Worksheet Functions 6 February 21st 07 02:25 PM
SUMPRODUCT formula - help! Kierano Excel Worksheet Functions 5 October 25th 06 05:47 PM
SUMPRODUCT formula shmurphing Excel Worksheet Functions 4 December 21st 04 10:43 PM


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