Average with date interval and product code

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:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob HensonFinance AnalystCommented:
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?
adrecalAuthor Commented:
The data is in VENDAS sheet. :-)
Thanks for your help.
Rob HensonFinance AnalystCommented:
Is it okay to rearrange the data as suggested?
Determine the Perfect Price for Your IT Services

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

Ejgil HedegaardCommented:
Try this
Formulas on sheet COMPRA.
Total in column G, and average in column H.
Date limits in G1 and H1.
Rob HensonFinance AnalystCommented:
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.
Rob HensonFinance AnalystCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
adrecalAuthor Commented:
Thank you guys! The second sheet from Rob did the trick, but the Ejgil sheet is amazing too.
Rob HensonFinance AnalystCommented:
Glad it worked for you.

Thanks for the feedback.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.