smide
Board Regular
- Joined
- Dec 20, 2015
- Messages
- 162
- Office Version
- 2016
- Platform
- Windows
Hello.
In column B (B2:B600) I have a product list (about 25 different products) and in column E their prices.
In column D I have a list of markers for each product. Markers are S - sold, W - waiting and A - away.
In column G (from cell G2 and downwards) I have list off ALL potential products.
I need a formula to find average of first price occurrence for each product IF the marker for previous occurrence for that product was A (away) and to put those results/averages in Column H.
example.
(for simplicity only for product 'apple')
<tbody>
</tbody>
cell H2 is average value for apple (first price after marker A for previous apple product): =average (E7,E11) = average(9,16) = 12.5
In column B (B2:B600) I have a product list (about 25 different products) and in column E their prices.
In column D I have a list of markers for each product. Markers are S - sold, W - waiting and A - away.
In column G (from cell G2 and downwards) I have list off ALL potential products.
I need a formula to find average of first price occurrence for each product IF the marker for previous occurrence for that product was A (away) and to put those results/averages in Column H.
example.
(for simplicity only for product 'apple')
A | B | C | D | E | F | G | H | |
1 | ||||||||
2 | apple | S | 12 | apple | 12.5 | |||
3 | sugar | 6 | sugar | .... | ||||
4 | apple | A | 14 | orange | .... | |||
5 | orange | 28 | .... | |||||
6 | sugar | 5 | ||||||
7 | apple | W | 9 | |||||
8 | sugar | 32 | ||||||
9 | orange | 11 | ||||||
10 | apple | A | 8 | |||||
11 | apple | S | 16 | |||||
12 | sugar | 20 | ||||||
13 | orange | 3 | ||||||
14 | sugar | 19 | ||||||
15 | apple | W | 9 | |||||
16 | sugar | 5 | ||||||
17 | .... | .... |
<tbody>
</tbody>