Average with date interval and product code

adrecal
adrecal used Ask the Experts™
on
Hello :-)

I have an excel spreadsheet where there is a product code and the sales amount of that product per day. I need to take the average sales per day range for a given product. How many sales for product 01 between 10/11 and 02/12 for example.

Some idea?

The spreadsheet:
med.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Rob HensonFinance Analyst

Commented:
If you are able to arrange the data differently then you could use a pivot table.

Ideal would be arranged in 3 columns:
Code    Date    Quantity

Can you upload a sample file rather than screenshot?

Author

Commented:
The data is in VENDAS sheet. :-)
Thanks for your help.
ESTOQUE.xlsx
Rob HensonFinance Analyst

Commented:
Is it okay to rearrange the data as suggested?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Try this
Formulas on sheet COMPRA.
Total in column G, and average in column H.
Date limits in G1 and H1.
ESTOQUE.xlsx
Rob HensonFinance Analyst

Commented:
See attached, New sheet with re-arranged data in a table and a pivot table summarising.

There are drop-downs so that you can filter on code or dates.
ESTOQUE.xlsx
Finance Analyst
Commented:
Another option for you with no need for rearranging the data or pivot table. This uses the OFFSET function to determine the range to SUM/AVERAGE.

The three inputs (Start Date, Finish Date and Code) are from drop-down lists which are also determined by the OFFSET function creating a dynamic range for each. In case the Start and Finish dates are chosen incorrectly the formula allows for them being the incorrect.
ESTOQUE.xlsx

Author

Commented:
Thank you guys! The second sheet from Rob did the trick, but the Ejgil sheet is amazing too.
Rob HensonFinance Analyst

Commented:
Glad it worked for you.

Thanks for the feedback.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial