smide
Board Regular
- Joined
- Dec 20, 2015
- Messages
- 161
- Office Version
- 2016
- Platform
- Windows
Hello.
In columns A and B (A3:B802) I have a list of 25 different products (Product 1 - Product 25) with their corresponding 'markers' in columns C and D (when Product is in column A his 'marker' is in the same row in column C, and when Product is in column B his 'marker' is in the same row but now in column D).
Each Product's marker can have a value of zero, one or three (0,1,3).
What I need to find is to COUNT how many consecutive times each Product appears without marker 3 relative to last Product's appearance WITH marker 3 (eg. previous Product with marker 3, Product in row with lower number).
Data in row 3 are those from which 'counting' starts.
example. (for simplicity here only for Product 1)
Results are in column E when the relevant Product is in column A.
Results are in column F when the relevant Product is in column B.
So, always look at previous cells when counting missing markers (lower than 3).
<tbody>
</tbody>Results: F5 = 1, because previous Product 1 (in cell A3) has marker (cell C3) with number 1 (less than 3) and result in F5 is 1 (if C3 = 3 than F5 = 0)
F6 = 0, because previous Product 1 (in cell B5) has marker which ALREADY contains number equal to 3 (cell D5)
E8 = 1, there is a ONE previous Product 1 (cell B6) with marker lower than 3 before counting 'hits' those Product 1 with marker equal to 3 (Product 1 in cell B5 with his marker in cell D5 = 3)
F9 = 2, similar story as for E8 but now there are TWO previous Product 1 cells with markers lower than 3 before counting 'hits' those with marker equal to 3 (row 5)
In columns A and B (A3:B802) I have a list of 25 different products (Product 1 - Product 25) with their corresponding 'markers' in columns C and D (when Product is in column A his 'marker' is in the same row in column C, and when Product is in column B his 'marker' is in the same row but now in column D).
Each Product's marker can have a value of zero, one or three (0,1,3).
What I need to find is to COUNT how many consecutive times each Product appears without marker 3 relative to last Product's appearance WITH marker 3 (eg. previous Product with marker 3, Product in row with lower number).
Data in row 3 are those from which 'counting' starts.
example. (for simplicity here only for Product 1)
Results are in column E when the relevant Product is in column A.
Results are in column F when the relevant Product is in column B.
So, always look at previous cells when counting missing markers (lower than 3).
A | B | C | D | E | F | |
1 | ||||||
2 | Marker 1 | Marker 2 | Results A | Results B | ||
3 | Product 1 | Product 5 | 1 | |||
4 | Product 4 | Product 2 | ||||
5 | Product 3 | Product 1 | 3 | 1 | ||
6 | Product 2 | Product 1 | 1 | 0 | ||
7 | Product 8 | Product 6 | ||||
8 | Product 1 | Product 2 | 0 | 1 | ||
9 | Product 3 | Product 1 | 3 | 2 | ||
10 | Product 2 | Product 5 | ||||
11 | .... | .... | ||||
12 | .... | .... |
<tbody>
</tbody>
F6 = 0, because previous Product 1 (in cell B5) has marker which ALREADY contains number equal to 3 (cell D5)
E8 = 1, there is a ONE previous Product 1 (cell B6) with marker lower than 3 before counting 'hits' those Product 1 with marker equal to 3 (Product 1 in cell B5 with his marker in cell D5 = 3)
F9 = 2, similar story as for E8 but now there are TWO previous Product 1 cells with markers lower than 3 before counting 'hits' those with marker equal to 3 (row 5)