-1

I have the following in a worksheet:

Daily login
------------
yes
no
yes
yes
no

For every YES I need a score of 5, and for every NO I need a score of -3.

I need to find the sum of all YES and NO in the column. e.g., in the above case, the total is 9 (3 x 5 = 15 for the YESs, plus 2 x -3 = -6 for the NOs). How can I do this with a formula?

2 Answers 2

0

Using IF function you can get the result for the cells as, (starting from B1

=IF(A1="yes", 5, IF(A1="no", -3, 0))

After that using SUM, you can get the expected result as, (placed at C1)

=SUM(B1:B5)

Screenshot:

Excel

0

Use two Countif():

=COUNTIF(A:A,"Yes")*5 + COUNTIF(A:A,"No")*-3

enter image description here

2
  • Thank you, it worked. Can you also tell me how can I add this formula within =IF((M34/5)+(N34/2.5)+F12+F22+F32+F42<100,(M34/5)+(N34/2.5)+F12+F22+F32+F42,"BRONE III ACHIEVED"). And if you can suggest a simpler formula that I did not know of.
    – Gowtham
    Apr 4, 2019 at 13:39
  • New questions get new posts. If this answered your question please mark it as correct by clicking the check mark by the answer. Apr 4, 2019 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .