Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 69
Default Sum if Critea 1 and critera 2 are met

Good day,

I have a column A2:A100 that specifies Q1,2,3,4
I have a column C2:C100 that specifies Product (either A or B)
in column F2:F100 I have price paid

Now I want to create a query that says if A2:A100 = Q1 and C2:C100 = product
A then add up all the matching prices from F2:F100

I was using this but I think I am missing something

=SUM(IF(((A2:A100)="Q4")*(MATCH(C2:C100,"prodA",0) ),F2::F100))

Any suggestions?

Thanks in advance

--
Nelson
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Sum if Critea 1 and critera 2 are met

Any time you have multiple criteria, use SUMPRODUCT():

=SUMPRODUCT(--(A2:A100="Q4")*(C2:C100="prodA")*(F2:F100))

--
Gary''s Student - gsnu200859


"Nelson" wrote:

Good day,

I have a column A2:A100 that specifies Q1,2,3,4
I have a column C2:C100 that specifies Product (either A or B)
in column F2:F100 I have price paid

Now I want to create a query that says if A2:A100 = Q1 and C2:C100 = product
A then add up all the matching prices from F2:F100

I was using this but I think I am missing something

=SUM(IF(((A2:A100)="Q4")*(MATCH(C2:C100,"prodA",0) ),F2::F100))

Any suggestions?

Thanks in advance

--
Nelson

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Sum if Critea 1 and critera 2 are met

And of course you can omit the double unary minus as you've used * to
multiply.

=SUMPRODUCT((A2:A100="Q4")*(C2:C100="prodA")*(F2:F 100)) or
=SUMPRODUCT(--(A2:A100="Q4"),--(C2:C100="prodA"),(F2:F100))
--
David Biddulph

"Gary''s Student" wrote in message
...
Any time you have multiple criteria, use SUMPRODUCT():

=SUMPRODUCT(--(A2:A100="Q4")*(C2:C100="prodA")*(F2:F100))

--
Gary''s Student - gsnu200859


"Nelson" wrote:

Good day,

I have a column A2:A100 that specifies Q1,2,3,4
I have a column C2:C100 that specifies Product (either A or B)
in column F2:F100 I have price paid

Now I want to create a query that says if A2:A100 = Q1 and C2:C100 =
product
A then add up all the matching prices from F2:F100

I was using this but I think I am missing something

=SUM(IF(((A2:A100)="Q4")*(MATCH(C2:C100,"prodA",0) ),F2::F100))

Any suggestions?

Thanks in advance

--
Nelson



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 69
Default Sum if Critea 1 and critera 2 are met

Thanks that help, now if I want to use the same criteria for getting the
Average of a column that has percentages would I change sum product to
Average?

Thanks
--
Nelson


"Gary''s Student" wrote:

Any time you have multiple criteria, use SUMPRODUCT():

=SUMPRODUCT(--(A2:A100="Q4")*(C2:C100="prodA")*(F2:F100))

--
Gary''s Student - gsnu200859


"Nelson" wrote:

Good day,

I have a column A2:A100 that specifies Q1,2,3,4
I have a column C2:C100 that specifies Product (either A or B)
in column F2:F100 I have price paid

Now I want to create a query that says if A2:A100 = Q1 and C2:C100 = product
A then add up all the matching prices from F2:F100

I was using this but I think I am missing something

=SUM(IF(((A2:A100)="Q4")*(MATCH(C2:C100,"prodA",0) ),F2::F100))

Any suggestions?

Thanks in advance

--
Nelson

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Sum if Critea 1 and critera 2 are met

Hi,

In 2007 you would use

=SUMIFS(F2:F100,A2:A100,"Q4",C2:C100,"prodA")

and

=AVERAGEIFS(F2:F100,A2:A100,"Q4",C2:C100,"prodA")

In 2003:

=AVERAGE(IF((A2:A100="Q4")*(C2:C100="prodA"),F2:F1 00,""))

This formula must be array entered - press Shift+Ctrl+Enter, instead of enter
or

=SUMPRODUCT(--(A2:A100="Q4"),--(C2:C100="prodA"),F2:F100)/=SUMPRODUCT(--(A2:A100="Q4"),--(C2:C100="prodA"))




--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Nelson" wrote:

Good day,

I have a column A2:A100 that specifies Q1,2,3,4
I have a column C2:C100 that specifies Product (either A or B)
in column F2:F100 I have price paid

Now I want to create a query that says if A2:A100 = Q1 and C2:C100 = product
A then add up all the matching prices from F2:F100

I was using this but I think I am missing something

=SUM(IF(((A2:A100)="Q4")*(MATCH(C2:C100,"prodA",0) ),F2::F100))

Any suggestions?

Thanks in advance

--
Nelson



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Sum if Critea 1 and critera 2 are met

In Fun:

And of course you can ommit the parentheses in the final argument of the
second formula when you use the double minus:

=SUMPRODUCT(--(A2:A100="Q4"),--(C2:C100="prodA"),(F2:F100))

=SUMPRODUCT(--(A2:A100="Q4"),--(C2:C100="prodA"),F2:F100)

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"David Biddulph" wrote:

And of course you can omit the double unary minus as you've used * to
multiply.

=SUMPRODUCT((A2:A100="Q4")*(C2:C100="prodA")*(F2:F 100)) or
=SUMPRODUCT(--(A2:A100="Q4"),--(C2:C100="prodA"),(F2:F100))
--
David Biddulph

"Gary''s Student" wrote in message
...
Any time you have multiple criteria, use SUMPRODUCT():

=SUMPRODUCT(--(A2:A100="Q4")*(C2:C100="prodA")*(F2:F100))

--
Gary''s Student - gsnu200859


"Nelson" wrote:

Good day,

I have a column A2:A100 that specifies Q1,2,3,4
I have a column C2:C100 that specifies Product (either A or B)
in column F2:F100 I have price paid

Now I want to create a query that says if A2:A100 = Q1 and C2:C100 =
product
A then add up all the matching prices from F2:F100

I was using this but I think I am missing something

=SUM(IF(((A2:A100)="Q4")*(MATCH(C2:C100,"prodA",0) ),F2::F100))

Any suggestions?

Thanks in advance

--
Nelson




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Sum if Critea 1 and critera 2 are met

I want to use the same criteria for getting
the Average of a column


What version of Excel are you using?

This will work in all versions of Excel.

Array entered**

=AVERAGE(IF((A2:A100="Q4")*(C2:C100="prodA"),F2:F1 00))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.


--
Biff
Microsoft Excel MVP


"Nelson" wrote in message
...
Thanks that help, now if I want to use the same criteria for getting the
Average of a column that has percentages would I change sum product to
Average?

Thanks
--
Nelson


"Gary''s Student" wrote:

Any time you have multiple criteria, use SUMPRODUCT():

=SUMPRODUCT(--(A2:A100="Q4")*(C2:C100="prodA")*(F2:F100))

--
Gary''s Student - gsnu200859


"Nelson" wrote:

Good day,

I have a column A2:A100 that specifies Q1,2,3,4
I have a column C2:C100 that specifies Product (either A or B)
in column F2:F100 I have price paid

Now I want to create a query that says if A2:A100 = Q1 and C2:C100 =
product
A then add up all the matching prices from F2:F100

I was using this but I think I am missing something

=SUM(IF(((A2:A100)="Q4")*(MATCH(C2:C100,"prodA",0) ),F2::F100))

Any suggestions?

Thanks in advance

--
Nelson



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
SUMIF when using a range with critera Kristopher Excel Discussion (Misc queries) 2 March 28th 07 02:58 AM
SUMIF when using a range with critera Teethless mama Excel Discussion (Misc queries) 0 March 28th 07 01:16 AM
SUMIF when using a range with critera John Excel Discussion (Misc queries) 0 March 28th 07 12:57 AM
Average only with specific critera Stephen Excel Discussion (Misc queries) 8 May 19th 06 06:06 PM
How do I sum with two critera? Clare Excel Discussion (Misc queries) 4 August 24th 05 03:05 PM


All times are GMT +1. The time now is 10:26 PM.

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"