Dashboard Mode - OFFSET for dynamic ranges
Dashboard Goal
Show total sales and average sales dynamically based on the number of months entered by the user.
Show total sales and average sales dynamically based on the number of months entered by the user.
| Month | Sales |
|---|---|
| Jan | 100 |
| Feb | 150 |
| Mar | 200 |
| Apr | 250 |
| May | 300 |
| Jun | 350 |
User enters number of months to analyze in cell B8.
B8 - Number of months to include (e.g., 3)=OFFSET(B2,0,0,B8,1) - Creates a range starting at B2 down for B8 rows=SUM(OFFSET(B2,0,0,B8,1)) - Sums sales for the selected months=AVERAGE(OFFSET(B2,0,0,B8,1)) - Calculates average sales for selected months=OFFSET(A2,0,0,B8,1) - Shows month names for selected months+----------------------+----------------------+ | Enter Months (B8) | [User input cell] | +----------------------+----------------------+ | Total Sales | [Total Sales value] | +----------------------+----------------------+ | Average Sales | [Average Sales value] | +----------------------+----------------------+ | Months Included | [List of months] | +----------------------+----------------------+
User changes the number in cell B8. This updates the dynamic ranges created by OFFSET. The total sales, average sales, and displayed months all update automatically to reflect the selected number of months.
If you change the value in B8 from 3 to 5, which components update?
All these components update to include sales and months for the first 5 months.