Often you may want to calculate the average value grouped by quarter in Excel.
For example, suppose we have the following dataset and we’d like to calculate the average daily sales, grouped by quarter:
The following step-by-step example shows how to do so.
Step 1: Enter the Data
First, enter the data values into Excel:
Step 2: Extract the Quarter from Dates
Next, we’ll type the following formula into cell D2 to extract the quarter from each date:
We’ll then drag and fill this formula down to every remaining cell in column D:
Step 3: Find the Unique Quarters
Next, we need to use the =UNIQUE() function to produce a list of unique quarters.
In our example, we’ll type the following formula in cell F2:
This will produce a list of unique quarters:
Step 4: Calculate the Average by Quarter
Next, we will use the AVERAGEIF(range, criterion, average_range) function to find the average of the daily sales values, grouped by quarter.
In our example, we’ll type the following formula in cell G2:
=AVERAGEIF($D$2:$D$16, F2, $B$2:$B$16)
We’ll then drag and fill this formula down to the remaining cells in column G:
Column G now shows the average daily sales during each quarter.
For example, we can see that the average daily sales during the first quarter of the year was 18.4.
We can manually verify this is correct by calculating the average of sales during each date that falls in January, February or March:
Average of Sales During Q1: (12 + 15 + 18 + 22 + 25) / 5 = 18.4
This matches the value calculated by our formula.
The following tutorials explain how to perform other common tasks in Excel: