Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We have 4 conference weeks a year. Some people who come, have come the year before. How do I calculate how many people have come the year before?

Session Pref 1               Attended Before
(2) June 24 - 28, 2013       No
(1) June 17 - 21, 2013       Yes
(1) June 17 - 21, 2013       No
(3) July 8 - 12, 2013        No
(3) July 8 - 12, 2013        Yes
(2) June 24 - 28, 2013       No
(2) June 24 - 28, 2013       No
(1) June 17 - 21, 2013       No

Thank you!

share|improve this question
1  
For the example you have in your question, what is the sum you are expecting to get and how would you calculate it? –  Jerry Sep 23 '13 at 12:44

2 Answers 2

awk '{if($7=="Yes") s+=1;} END {print s}' test.txt

Use awk for counting the Yes-entries and sum it up!

share|improve this answer
    
I presume the OP is looking for a solution in Excel, given that the question is tagged microsoft-excel-2010. –  John Bensin Sep 23 '13 at 13:15

Let's say your columns are A and B. If you just want the total number of people who are marked "Yes" in column B, use the following:

=countif(B:B, "Yes")

If you want the number of "Yes" answers for a given session, use the following:

=countifs(A:A, "(1) June 17 - 21, 2013", B:B, "Yes")

You probably want cell references instead, so that it's easier to change:

=countifs(A:A, C1, B:B, D1)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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