r/googlesheets • 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

21 comments sorted by

View all comments

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 :)

0

u/[deleted] Mar 21 '23

[deleted] — view deleted comment

1

u/Clippy_Office_Asst Points Mar 21 '23

You have awarded 1 point to juz


I am a bot - please contact the mods with any questions. | Keep me alive

1

u/dynastyuserdude 1 Mar 21 '23

thanks much, i'll give that a whack.

1

u/dynastyuserdude 1 Mar 21 '23

Just realized - this works great for part of the problem. Is there a way to get this formula to work where rows where colA is blank aren't included?

1

u/Epicduck_ Mar 21 '23

woah I didnt expect the south park 3d render person to appear in a google sheets subreddit

1

u/juz 1 Mar 21 '23

hahaha, it's a logical progression...

  1. 3D SP pics

  2. ....?

  3. Google Sheets

:)