Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Inter
 
Posts: n/a
Default sumif for multiple criteria

I'm trying to sum the contents of multiple rows based on specifying 2
criteria, e.g.

downloads brand country
5 A US
10 A US
10 B UK
5 B UK
10 A UK
10 B US

And i want to add the downloads for brand B in the UK...

A bit of help would be much appreciated.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chris Marlow
 
Posts: n/a
Default sumif for multiple criteria

Inter,

SUMPRODUCT may help.

Assuming you paste your data in top left corner of the sheet;

=SUMPRODUCT(A2:A7,IF(B2:B7="B",1,0),IF(C2:C7="UK", 1,0))

But commit with CTRL-SHIFT-ENTER to make it an array formula.

Regards,

Chris.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Master


"Inter" wrote:

I'm trying to sum the contents of multiple rows based on specifying 2
criteria, e.g.

downloads brand country
5 A US
10 A US
10 B UK
5 B UK
10 A UK
10 B US

And i want to add the downloads for brand B in the UK...

A bit of help would be much appreciated.
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default sumif for multiple criteria

=sumproduct(--(b1:b10="B"),--(c1:c10="UK"),(a1:a10))

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

========
If you have lots of these to do, you may want to invest a little time in
learning about pivottables.

Here are a few links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx


Inter wrote:

I'm trying to sum the contents of multiple rows based on specifying 2
criteria, e.g.

downloads brand country
5 A US
10 A US
10 B UK
5 B UK
10 A UK
10 B US

And i want to add the downloads for brand B in the UK...

A bit of help would be much appreciated.
Thanks


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
mr_teacher
 
Posts: n/a
Default sumif for multiple criteria


If you also wanted to be able to specify which brand and which country
you wanted to look at and avoid having to put a new formula in for each
one could you put the product code in cell e2 (e.g. B) and the country
code (e.g. UK)in cell f2 and then use the formula in g2

=SUMPRODUCT(--(B1:B10=E2),--(C1:C10=F2),(A1:A10))

This should allow you to specify any combination and see the total.


--
mr_teacher
------------------------------------------------------------------------
mr_teacher's Profile: http://www.excelforum.com/member.php...o&userid=34352
View this thread: http://www.excelforum.com/showthread...hreadid=543011

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
How do I use the sumif if I have multiple criteria (i.e. greater . Kellyatisl Excel Worksheet Functions 3 June 4th 06 06:33 AM
Multiple SUMIF Criteria azazel Excel Worksheet Functions 3 November 10th 05 08:31 PM
SUMIF with Mutiple Ranges & Criteria PokerZan Excel Discussion (Misc queries) 5 August 4th 05 10:31 PM
"criteria" in a sumif refering to the value in another cell mark Excel Discussion (Misc queries) 1 January 31st 05 07:39 PM
Can I use a cell reference in the criteria for the sumif function. Number Cruncher Excel Worksheet Functions 2 November 4th 04 07:52 PM


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