Summing 2 columns based on variables

S

Steve

This replicates through hundreds of rows.
I need the total hours scheduled by day based on the 0 or 1s in the cloumns
, and the # of variable hours in the z column.
In the following, in cell S2, I need a formula to look at S5, if it's a
zero, then 0, if it's a 1, then add whatever is in the z column ( in this
case an 8), then to add up all the S column cells based on if there' a 1 in
that column, then whatever the Z column shows. In this scenario, cell S1
would have 18, because 1's are in 7,8 &9 -SUM(Z7:Z9). And U2 would have 24,
because 1's are in 5,6,& 8, - Z5+Z6+Z8, etc.

s t u v w x y
z
4 Sat Sun Mon Tue Wed Thu Fri hrs
5 0 0 1 1 1 1 1 8
6 0 0 1 1 1 1 1 8
7 1 0 0 1 1 1 1 5
8 1 1 1 1 1 0 0 8
9 1 1 0 0 1 1 1 5

18 13 24 29 34 26 26

Much thanks,

Steve
 

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