Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Sum Values in One Range Based on Criteria in Another

I have a spreadsheet with a list of weights and another list based on a drop-down selection with the choices "Yes" and "No" and I need to make a weighted sum from it.

Right now I have a very nasty looking function:


I'd like to find a way to simplify this. A sample set of data looks like this:

| 1 | Yes |
| 4 | No  |
| 1 | Yes |
| 2 | Yes |
| 2 | No  |

This would produce a result of 1+1+2=4

Is there any way to get results like this in a simpler way than the way I'm currently using?

share|improve this question

marked as duplicate by Sathya Jun 3 '12 at 9:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 3 down vote accepted

=SUMIF(B:B,"yes",A:A) Use the sumif formula

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.