Friday, October 3, 2014

yogi_Compute Average Number Of Purchases By ItemID For a Given Range Of Dates

Google Spreadsheet   Post  #1779
Yogi Anand, D.Eng, P.E.      ANAND Enterprises LLC -- Rochester Hills MI     www.energyefficientbuild.com.   Sep-27-2014
post by  QuickQuestionPlz:
(https://productforums.google.com/forum/#!category-topic/docs/spreadsheets/WBWTlUJ5WnE)
Please help with populating a column with data from other columns based on a condition
Hello all,

I'm a bit new to using Docs for spreadsheets, and was wondering if I could get some help really quick. Also, my apologies if I haven't worded this very well. Here's the scenario:

I'm working with some simple sales figures, and I want to know how to use some simple formulas for separating the data based on certain conditions. Here is a sample of the data I'll be working with:

 date itemID purchases buyers 1/1/2014 1 10 7 1/2/2014 1 8 6 1/3/2014 1 13 8 1/1/2014 2 6 3 1/2/2014 2 6 4 1/3/2014 2 5 3 1/1/2014 3 2 2 1/2/2014 3 1 1 1/3/2014 3 3 3

I want to write a formula that figures out the average purchases for each item for between two dates. However, I will be working with thousands of items. Basically, the formula would populate a column like the Average Purchases column below, except it would do so for thousands of items instead of just 3.

 Date Range ItemID Average Purchases 1/1/2014 - 1/3/2014 1 10.33333333 1/1/2014 - 1/3/2014 2 5.666666667 1/1/2014 - 1/3/2014 3 2

Any help is greatly appreciated! Thanks!

------------------------------------------------------------------------------------------------------------------------