Hey guys,
I am trying to make a project where I have a spreadsheet with 3 sheets:
database with 3 column: A = date, B=Product, C = Price like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Sales date (tbl_date)[/TD]
[TD]Product (tbl_product)[/TD]
[TD]Price (tbl_price)[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]January 5, 2010[/TD]
[TD]17/18 FC[/TD]
[TD]+20[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]January 6, 2010[/TD]
[TD]17/18 FC[/TD]
[TD]+18[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2 (chart) where I want the formula, I can manualy change year on B2, select quality on dropbdown list which is being taken from defined name on sheet 3, and results from C2 through E#.
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Year[/TD]
[TD]2012[/TD]
[TD]17/18 FC[/TD]
[TD]dropdown 2[/TD]
[TD]dropdown 3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]January[/TD]
[TD]19 (for instance)[/TD]
[TD]Avg result[/TD]
[TD]Avg result[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]February[/TD]
[TD]Avg result[/TD]
[TD]Avg result[/TD]
[TD]Avg result[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 3 (qualities) = unique names of all products for the dropdown list.
I am trying to get the average price of X product sold on month and year, at the moment I was only able to get the price of the product on the day with the formula:
<code style="margin: 0px; padding: 0px; font-style: inherit; line-height: 12px;">=AVERAGE((MONTH(tbl_date)=$A2)*(YEAR(tbl_date)=$B$1)*(tbl_product=C$1)*tbl_price)</code>
I don't really get the average sale of that product, but a very different number, - I guess it's the average of this to the whole table... can someone please help?
Attached is a example of the sheet.
Appreciate any help, not sure if I can upload the excel or not, but I tried to explain my problem as detailed as I could![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
PS: A PivotTable would not work so well, I have over 50 products, and it would be an enormous thing, and I want to be able to check price of one product with another and make a easy chart
I am trying to make a project where I have a spreadsheet with 3 sheets:
database with 3 column: A = date, B=Product, C = Price like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Sales date (tbl_date)[/TD]
[TD]Product (tbl_product)[/TD]
[TD]Price (tbl_price)[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]January 5, 2010[/TD]
[TD]17/18 FC[/TD]
[TD]+20[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]January 6, 2010[/TD]
[TD]17/18 FC[/TD]
[TD]+18[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2 (chart) where I want the formula, I can manualy change year on B2, select quality on dropbdown list which is being taken from defined name on sheet 3, and results from C2 through E#.
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Year[/TD]
[TD]2012[/TD]
[TD]17/18 FC[/TD]
[TD]dropdown 2[/TD]
[TD]dropdown 3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]January[/TD]
[TD]19 (for instance)[/TD]
[TD]Avg result[/TD]
[TD]Avg result[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]February[/TD]
[TD]Avg result[/TD]
[TD]Avg result[/TD]
[TD]Avg result[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 3 (qualities) = unique names of all products for the dropdown list.
I am trying to get the average price of X product sold on month and year, at the moment I was only able to get the price of the product on the day with the formula:
![select_all_icon.jpg](/board/proxy.php?image=http%3A%2F%2Fwww.excelforum.com%2Fclientscript%2Fselect_all_icon.jpg&hash=2eb3821b1675c68d32f61d531b1bcbf6)
![page_white_copy.png](/board/proxy.php?image=http%3A%2F%2Fstatic.beckelman.net%2Fv1%2Fimg%2Fpage_white_copy.png&hash=4e37aa15482f28f68ed1bdf13a0e214a)
<code style="margin: 0px; padding: 0px; font-style: inherit; line-height: 12px;">=AVERAGE((MONTH(tbl_date)=$A2)*(YEAR(tbl_date)=$B$1)*(tbl_product=C$1)*tbl_price)</code>
I don't really get the average sale of that product, but a very different number, - I guess it's the average of this to the whole table... can someone please help?
Attached is a example of the sheet.
Appreciate any help, not sure if I can upload the excel or not, but I tried to explain my problem as detailed as I could
![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
PS: A PivotTable would not work so well, I have over 50 products, and it would be an enormous thing, and I want to be able to check price of one product with another and make a easy chart
![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
Last edited: