Hello,</SPAN></SPAN>
I need a VBA solution, which can count upper value only if the line below has 0. Result in column S</SPAN></SPAN>
Example counts of the row 7 values, only if the lower row 8 has 0...Row 8 has 5 0's over it in the row 7 has numbers 0, 1, 3 & 4 (0=2, 1=1, 3=3 & 4=1) result S7 = 2 | 1 | 1 | 1, and the count method will be applied the same for rest of the rows.</SPAN></SPAN>
Here is an example....</SPAN></SPAN>
Thank you all</SPAN></SPAN>
Excel 2000</SPAN></SPAN>
Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
I need a VBA solution, which can count upper value only if the line below has 0. Result in column S</SPAN></SPAN>
Example counts of the row 7 values, only if the lower row 8 has 0...Row 8 has 5 0's over it in the row 7 has numbers 0, 1, 3 & 4 (0=2, 1=1, 3=3 & 4=1) result S7 = 2 | 1 | 1 | 1, and the count method will be applied the same for rest of the rows.</SPAN></SPAN>
Here is an example....</SPAN></SPAN>
Book1 | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | |||
1 | |||||||||||||||||||||
2 | |||||||||||||||||||||
3 | |||||||||||||||||||||
4 | |||||||||||||||||||||
5 | n1 | n2 | n3 | n4 | n5 | n6 | n7 | n8 | n9 | n10 | n11 | n12 | n13 | n14 | Count 0 To Increment Values | ||||||
6 | |||||||||||||||||||||
7 | 4 | 1 | 1 | 0 | 6 | 0 | 4 | 0 | 1 | 3 | 5 | 0 | 2 | 1 | 2 | 1 | 1 | 1 | ||||||
8 | 5 | 0 | 2 | 1 | 7 | 1 | 0 | 0 | 2 | 0 | 6 | 0 | 3 | 2 | 3 | ||||||
9 | 6 | 0 | 3 | 2 | 8 | 2 | 0 | 0 | 3 | 1 | 7 | 1 | 4 | 3 | 1 | 1 | 1 | ||||||
10 | 7 | 1 | 0 | 0 | 9 | 3 | 1 | 1 | 4 | 2 | 8 | 2 | 0 | 4 | 1 | 1 | 1 | ||||||
11 | 8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