M: In libreoffice calc, I need to count all the non-blank values in a range; counta() isn’t working because, even though the contents are blank, there are filters and formulas that are registering as being an entry.
G: To count only non-blank
visible cells in a range (excluding cells that appear blank due
to formulas or filters), you can use an array formula combined with
SUBTOTAL and LEN. Here's how:
Assume your range is
A1:A100.
Use this formula:
=SUMPRODUCT(SUBTOTAL(103,OFFSET(A1:A100,ROW(A1:A100)-MIN(ROW(A1:A100)),0,1)),LEN(A1:A100)>0)SUBTOTAL(103, ...): Counts only visible cells when
filters are applied.LEN(A1:A100)>0: Checks if the cell is truly
non-blank (ignores formulas returning empty strings).SUMPRODUCT: Combines the two conditions to count
non-blank visible cells.Enter (no need for Ctrl+Shift+Enter
in newer LibreOffice versions).This method should bypass your issue with filters and formulas.
M: Will this work for text?
G: Yes, the formula will work for text values. Here's why:
LEN(A1:A100) > 0 checks if the length of the text
(or value) in a cell is greater than 0. This condition ensures that even
if the cell contains text, it will be counted as long as it is not empty
(and visible).It will exclude:
"" (empty strings).So, it effectively counts only the visible, non-blank cells, including those containing text.
M: If I wanted to practice power query, can you name some good sets of data that are easily accessible I could use to practice on
G: Here are some ideas for accessible and varied datasets you can use to practice Power Query:
Kaggle
Google Dataset Search
Data.gov
World Bank Open Data
OpenStreetMap (OSM)
CSV Exports from Tools You Use
Online Retailers
Wikipedia Tables
Movie Databases
Supermarket Price Lists
Fantasy Sports Data
Board Game Data
Music Charts
Stock Market Data
Weather Data
Survey Data
Let me know if you'd like specific instructions for connecting any of these to Power Query!