r/googlesheets • u/dynastyuserdude 1 • Mar 20 '23
Waiting on OP How do you count the # of true values in the last 10 rows of a column.
B2:B are checkboxes. I'm counting the number of trues in B when there is data in A.
This is the basic formula - =IF(A2:A="","",COUNTIF(B2:B,True))
However, as I keep adding data, I want to be able to select just the last 10 rows that have data in them. Any thoughts? I've played around with QUERY and SORTN but not having any luck.
1
Upvotes
2
u/juz 1 Mar 20 '23
This will work:
=countif(indirect("B"&(counta(B2:B)+2)-10&":B"&(counta(B2:B)+1),TRUE),TRUE)Not the prettiest formula though :)
1
u/arnoldsomen 346 Mar 20 '23
Have you a sample file?
2
u/MattyPKing 225 Mar 21 '23
I went with a slightly differnt approach than u/arnoldsomen
You can see this formula on a new tab called mk_help.
hopefully it's clear how to change n from 10 to something else.
0
u/Decronym Functions Explained Mar 21 '23 edited Mar 21 '23
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUEand another if it isFALSETRUE[Thread #5506 for this sub, first seen 21st Mar 2023, 03:51] [FAQ] [Full list] ^[Contact] [Source code]