ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SumIf with OR criteria (https://www.excelbanter.com/excel-worksheet-functions/202062-sumif-criteria.html)

IA_sit

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

FSt1

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


Don Guillett

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



T. Valko

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




Teethless mama

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


John_John

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



All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com