Getting Average of Future Data

L

Legacy 389185

Guest
Hello everyone, I have a list box which contains data like;


FromToProduct Type2015Price2016Price2017Price
YorkCenterA5010040
YorkCenterB502070
CenterYorkB205080
YorkCenterB403050

<tbody>
</tbody>

So through a new record button, I'm able to add new rows and data to this list and I'm also able to filter this data. When I type 'B' in my filter product type text box, the list only shows the rows with product type B.

So I need 3 text boxes which should show me the average for 2015, 2016, 2017 Prices but it should show it only for the visible rows. For example if I don't write anything in filter text box, these average boxes should display the averages for all rows but if I filter by product type B, it should calculate and show the price averages for all product type B which means 3 rows. Also if I filter by from York to Center and Product Type B, it should calculate just for 2 rows because 2 rows will be displayed because of the filter.

Another problem is, since I'm able to add new rows, the system should be able to put it in the average calculation. For example if I add another row like this;

YorkCenterB203050

<tbody>
</tbody>

and when I filter like YORK CENTER and Product Type B, it should calculate the average for 3 rows since 3 rows will be displayed.

Can you help me with that? :)
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Since you are able to filter the data for the listbox, use the same filter criteria in a DSum expression for the calculated control. Look here under Domain Aggregate Functions.
 
Upvote 0

Forum statistics

Threads
1,221,783
Messages
6,161,940
Members
451,730
Latest member
BudgetGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top