0

I'm having trouble finding a short formula when adding columns in excel.

A B C D E F G H
1 Monday Monday Tuesday Tuesday Wednesday Wednesday Thursday Thursday
2 Day Night Day Night Day Night Day Night
3 10 5 0 10 0 5 10 10

I want to sum only the night of the days whose day number is zero. You can see the long formula below.

=IF(A3=0;B3;0)+IF(C3=0;D3;0)+IF(E3=0;F3;0)+IF(G3=0;H3;0)

The result should be 15. Since there are no numbers during the daytime on Tuesdays and Wednesdays, it should be summing night numbers. It is short for 4 days but very long to write this formula for a month. Thank you in advance.

1 Answer 1

1

Try SUMPRODUCT().

=SUMPRODUCT((A4:I4=0)*(A3:I3="Day")*(B4:J4))

Or SUMPRODUCT().

=SUM(FILTER(B4:J4,(A3:I3="Day")*(A4:I4=0)))

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.