Adding with multiple conditions

G

Gavin Robertson

In Excel 97 I have a list of items (groceries, i.e. bread, milk, tea,
coffee, apples etc) in column A and their corresponding cost in column B. I
want to add the cost of all the items that are either "bread", "milk" or
"tea".

The following works:

=SUMIF(A1:A10,"bread",B1:B10)+SUMIF(A1:A10,"milk",B1:B10)+SUMIF(A1:A10,"tea"
,B1:B10)

but there has to be a more elegant solution - possibly an array formula? I
have tried various ways of building the OR function into the SUMIF function
but to no avail.

Any help would be greatly appreciated.



Gavin
 

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