Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
djk djk is offline
external usenet poster
 
Posts: 4
Default sum if with multiple criteria

how can I use multiple criteria and the sum if function.

how could I sum for "red apples"?

ColA ColB ColC
red apples 5
green apples 2
baby carrots 1
red apples 3

Thanks

--
djk
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default sum if with multiple criteria

If you have Excel 2007 you could use the new SUMIFS() function. If you're
using an older version, as most of us [probably] are, then the SUMPRODUCT()
function is what you need:

=SUMPRODUCT(--(A2:A5="red"),--(B2:B5="apples"),C2:C5)

That assumes the first entry is in row 2 and that row 1 probably contains
column labels.

You could even set it up to give you product totals in another area, by
entering the different product descriptions in 2 columns and putting the
formula next to them, as
Col G Col H Col I
red apples =SUMPRODUCT(--(A$2:A$5=G2),--(B$2:B$5=H2),C$2:C$5)
green apples =SUMPRODUCT(--(A$2:A$5=G3),--(B$2:B$5=H3),C$2:C$5)
baby carrots =SUMPRODUCT(--(A$2:A$5=G4),--(B$2:B$5=H4),C$2:C$5)

Note that after you enter the formula in I2, it fills down very nicely.

"djk" wrote:

how can I use multiple criteria and the sum if function.

how could I sum for "red apples"?

ColA ColB ColC
red apples 5
green apples 2
baby carrots 1
red apples 3

Thanks

--
djk

  #3   Report Post  
Posted to microsoft.public.excel.misc
djk djk is offline
external usenet poster
 
Posts: 4
Default sum if with multiple criteria

thanks, I'm trying your suggestion, but still struggling

what if both red and apples are variables or cells I'd like to point.
assume multple colors in ColA and multiple fruits in ColB in the range, but
the red and apples would be a defined cell on another worksheet where I am
looking for totals.
--
djk


"JLatham" wrote:

If you have Excel 2007 you could use the new SUMIFS() function. If you're
using an older version, as most of us [probably] are, then the SUMPRODUCT()
function is what you need:

=SUMPRODUCT(--(A2:A5="red"),--(B2:B5="apples"),C2:C5)

That assumes the first entry is in row 2 and that row 1 probably contains
column labels.

You could even set it up to give you product totals in another area, by
entering the different product descriptions in 2 columns and putting the
formula next to them, as
Col G Col H Col I
red apples =SUMPRODUCT(--(A$2:A$5=G2),--(B$2:B$5=H2),C$2:C$5)
green apples =SUMPRODUCT(--(A$2:A$5=G3),--(B$2:B$5=H3),C$2:C$5)
baby carrots =SUMPRODUCT(--(A$2:A$5=G4),--(B$2:B$5=H4),C$2:C$5)

Note that after you enter the formula in I2, it fills down very nicely.

"djk" wrote:

how can I use multiple criteria and the sum if function.

how could I sum for "red apples"?

ColA ColB ColC
red apples 5
green apples 2
baby carrots 1
red apples 3

Thanks

--
djk

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default sum if with multiple criteria

Perhaps working examples will help you some more.
Click this link and save the file to your system and examine the 1st 2
worksheets in it for examples of use of the formula, both on the same sheet,
and in conjunction with lists on the second sheet.
http://www.jlathamsite.com/uploads/d...ctExamples.xls

If you have any questions about it, let me know.

"djk" wrote:

thanks, I'm trying your suggestion, but still struggling

what if both red and apples are variables or cells I'd like to point.
assume multple colors in ColA and multiple fruits in ColB in the range, but
the red and apples would be a defined cell on another worksheet where I am
looking for totals.
--
djk


"JLatham" wrote:

If you have Excel 2007 you could use the new SUMIFS() function. If you're
using an older version, as most of us [probably] are, then the SUMPRODUCT()
function is what you need:

=SUMPRODUCT(--(A2:A5="red"),--(B2:B5="apples"),C2:C5)

That assumes the first entry is in row 2 and that row 1 probably contains
column labels.

You could even set it up to give you product totals in another area, by
entering the different product descriptions in 2 columns and putting the
formula next to them, as
Col G Col H Col I
red apples =SUMPRODUCT(--(A$2:A$5=G2),--(B$2:B$5=H2),C$2:C$5)
green apples =SUMPRODUCT(--(A$2:A$5=G3),--(B$2:B$5=H3),C$2:C$5)
baby carrots =SUMPRODUCT(--(A$2:A$5=G4),--(B$2:B$5=H4),C$2:C$5)

Note that after you enter the formula in I2, it fills down very nicely.

"djk" wrote:

how can I use multiple criteria and the sum if function.

how could I sum for "red apples"?

ColA ColB ColC
red apples 5
green apples 2
baby carrots 1
red apples 3

Thanks

--
djk

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
match multiple criteria ina range from multiple criteria multiplet RG Excel Worksheet Functions 8 September 28th 07 04:21 AM
How to retrieve multiple values in multiple rows with one criteria bac Excel Discussion (Misc queries) 2 June 15th 07 08:57 PM
Index & Match functions - multiple criteria and multiple results [email protected] Excel Worksheet Functions 4 May 2nd 07 03:13 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Saleem Excel Worksheet Functions 1 January 12th 05 10:54 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Arain Excel Worksheet Functions 1 January 12th 05 08:33 AM


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