Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default SumIf with OR criteria

Data as below
Comp A 10
Comp B 50
Comp C 80
Comp D 100

Assume data starts from column A, I want to sum data in column B when column
A is either Comp A or Comp B (answer would be 90). Many posts asked for 2
criteria is usually AND so those formulea don't work out so far.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default SumIf with OR criteria

hi
try something like this.
=SUMIF(A2:A5,"Comp A",B2:B5)+SUMIF(A2:A5,"Comp B",B2:B5)

and i think it adds up to 60.

regards
FSt1

"IA_sit" wrote:

Data as below
Comp A 10
Comp B 50
Comp C 80
Comp D 100

Assume data starts from column A, I want to sum data in column B when column
A is either Comp A or Comp B (answer would be 90). Many posts asked for 2
criteria is usually AND so those formulea don't work out so far.

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default SumIf with OR criteria

Answer for a & b would b2 60. For a & c it would be 90
=SUMPRODUCT((G1:G21={"comp a","comp b"})*H1:H21)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"IA_sit" wrote in message
...
Data as below
Comp A 10
Comp B 50
Comp C 80
Comp D 100

Assume data starts from column A, I want to sum data in column B when
column
A is either Comp A or Comp B (answer would be 90). Many posts asked for 2
criteria is usually AND so those formulea don't work out so far.

Thanks in advance


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SumIf with OR criteria

either Comp A or Comp B (answer would be 90).

I think the correct answer based on your sample would be 60.

Try one of these:

=SUM(SUMIF(A1:A4,{"Comp A","Comp B"},B1:B4))

=SUMIF(A1:A4,"Comp A",B1:B4)+SUMIF(A1:A4,"Comp B",B1:B4)


--
Biff
Microsoft Excel MVP


"IA_sit" wrote in message
...
Data as below
Comp A 10
Comp B 50
Comp C 80
Comp D 100

Assume data starts from column A, I want to sum data in column B when
column
A is either Comp A or Comp B (answer would be 90). Many posts asked for 2
criteria is usually AND so those formulea don't work out so far.

Thanks in advance



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default SumIf with OR criteria

=SUMPRODUCT((A1:A4="Comp "&{"A","B"})*B1:B4)


"IA_sit" wrote:

Data as below
Comp A 10
Comp B 50
Comp C 80
Comp D 100

Assume data starts from column A, I want to sum data in column B when column
A is either Comp A or Comp B (answer would be 90). Many posts asked for 2
criteria is usually AND so those formulea don't work out so far.

Thanks in advance



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default SumIf with OR criteria

Array formula. (Ctrl+Shift+Enter)

=SUM(((A1:A4="Comp A")+(A1:A4="Comp B"))*B1:B4)

John

Ο χρήστης "IA_sit" *γγραψε:

Data as below
Comp A 10
Comp B 50
Comp C 80
Comp D 100

Assume data starts from column A, I want to sum data in column B when column
A is either Comp A or Comp B (answer would be 90). Many posts asked for 2
criteria is usually AND so those formulea don't work out so far.

Thanks in advance

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 Sumif and have the criteria be 10 AND <26? Jose Excel Discussion (Misc queries) 2 October 25th 07 08:21 PM
SUMIF with more than one criteria EJ Excel Discussion (Misc queries) 2 July 19th 06 02:19 PM
sumif criteria Bob B. Excel Discussion (Misc queries) 3 June 28th 06 05:29 PM
nested sumif or sumif with two criteria dshigley Excel Worksheet Functions 5 April 5th 05 03:34 AM
Sumif() with criteria Jim May Excel Worksheet Functions 4 February 18th 05 02:29 PM


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