Dashboard Mode - LIMIT and OFFSET
Goal
Show how to display a limited number of rows from a data table and skip some rows using formulas in Google Sheets.
Show how to display a limited number of rows from a data table and skip some rows using formulas in Google Sheets.
| Row | Product | Sales |
|---|---|---|
| 1 | Apples | 100 |
| 2 | Bananas | 150 |
| 3 | Cherries | 200 |
| 4 | Dates | 250 |
| 5 | Elderberries | 300 |
| 6 | Figs | 350 |
| 7 | Grapes | 400 |
=ARRAY_CONSTRAIN(A2:C8, 3, 3)=INDEX(A2:C8, SEQUENCE(3), SEQUENCE(1,3)) with OFFSET logic:=INDEX(A2:C8, ROW(A5:A7)-ROW(A2)+1, COLUMN(A2:C2)-COLUMN(A2)+1)=ARRAY_CONSTRAIN(OFFSET(A2:C8, 3, 0), 3, 3)=SUM(INDEX(A2:C8, SEQUENCE(3)+3, 3))+-----------------------------+ | LIMIT 3 (Rows 1-3) | | Apples, Bananas, Cherries | +-----------------------------+ | OFFSET 3 + LIMIT 3 (Rows 4-6)| | Dates, Elderberries, Figs | +-----------------------------+ | Total Sales of OFFSET rows | | (Dates to Figs) | +-----------------------------+
User can change the number of rows to show by editing the number in the ARRAY_CONSTRAIN or OFFSET formulas. For example, changing LIMIT from 3 to 2 will show fewer rows. Changing OFFSET value will skip more or fewer rows.
If you change the OFFSET value from 3 to 4, which rows will Component 2 show? What will be the new total sales?