adding values of cells

A

AJ Patel

I am trying to use a formula or function that will look at a cells say column
A check for a condition, if true, then add the value of another cell that is
on the same row to another cell. Yes I know that may be difficult to
understand so let me give you an example.

A B C D
1
2 dvd 25.23
3 cd 12.25
4 dvd 25.23
5 cd 12.25
6 bat 19.25

ok so what i want to do is look at column A, and look for any cells that
have dvd and add the corresponding value from column D to cell B1. So in
this case we can see the cell A2 and cell A4 is dvd so I want to add cells D2
and D4 and that value being placed in B1. Also, how could do the same thing
but look for multible conditions from column A, if i wanted to add the total
value of anything that has "dvd" and "cd" in Column A
 
T

T. Valko

Try these:

For a single criteria:

=SUMIF(A2:A6,"dvd",D2:D6)

For multiple criteria:

=SUM(SUMIF(A2:A6,{"dvd","cd"},D2:D6))
 
M

Max

For multiple conditions, something like this:
=SUMPRODUCT((ISNUMBER(MATCH(A2:A100,{"dvd","cd"},0)))*D2:D100)

For the single condition, use the simpler SUMIF, eg:
=SUMIF(A:A,"dvd",D:D)
 

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