SumIf with OR criteria

I

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
 
F

FSt1

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
 
D

Don Guillett

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

T. Valko

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)
 
J

John_John

Array formula. (Ctrl+Shift+Enter)

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

John

Ο χÏήστης "IA_sit" έγγÏαψε:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top