 # [Video Tutorial] Always show the last 4 items in your home screen

Hello Glide comunity,

Today I’ll teach you how to always show the latest 4 items in your homescreen of your Glide app using a few formulas on your spreadsheets

The formulas i use in the video are:

=ARRAYFORMULA(if(\$E2:\$E = index(\$E\$2:\$E, COUNTA(\$E\$2:\$E)),“TRUE”, ) & ARRAYFORMULA(if(\$E2:\$E = index(\$E\$2:\$E, COUNTA(\$E\$2:\$E)-1),“TRUE”, )) & ARRAYFORMULA(if(\$E2:\$E = index(\$E\$2:\$E, COUNTA(\$E\$2:\$E)-2),“TRUE”, )) & ARRAYFORMULA(if(\$E2:\$E = index(\$E\$2:\$E, COUNTA(\$E\$2:\$E)-3),“TRUE”, )))

The explanation is:

if(\$E2:\$E = index(\$E\$2:\$E, COUNTA(\$E\$2:\$E)),“TRUE”, )
If any item of the “E” column is equal to the last item of the same “E” column then return TRUE, and if not, just leave it empty.

COUNTA(\$E\$2:\$E))
This will count all the populated cells in the “E” column starting from “E2”

index(\$E\$2:\$E, COUNTA(\$E\$2:\$E)-1)
Here we are getting the last value -1 of the “E” column. Index shows the value of a cell in a range, in this case column “E”, and the row is calculated by COUNTA but -1.

15 Likes

Great work, thanks for sharing 1 Like

Why you not make new sheet tab, then just use query, order by timestamp and limit 4

3 Likes

Agreed that is what I have used.

2 Likes

because then i would have to create another sheet tab for every category i have and it’s just annoying to have too much sheet tabs haha

Thanks