How to you selectively sum on a series of numbers?

G

Guest

I have a column filled with numbers, but I only want to sum up a few of them.

Let's say I have numbers filling A1:A10. Let's say I only want to sum up
the numbers located is A3 and A4. I'd like to ability to enter something in
the b column (e.g. "y" in cells b3 and b4) and have a formula that adds up
the values in the "A" cells that have a corresponding "y" in the "B" column.
This formula would allow me to selectively choose which cells needs to be
summed.

What is the best/cleanest way to write that formula? Thank you.
 
A

Alex Delamain

=SUMPRODUCT((A1:A10)*(B1:B10="y"))

this will add up all values in A where the value in B is "Y
 

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