Tabular layout: one row per record, one column per kind of value
Most trouble with advanced Excel traces back to how the data was typed on day one. The layout that formulas, filters and PivotTables read smoothly is called tabular. The top row holds one header per column, every row beneath it is a complete record (a single sale, a single attendance entry, a single test score), and every column holds one kind of value. Merged cells, two-row headers, subtotals tucked between records and blank rows separating the months all look tidy on screen, yet each of them breaks the range Excel is trying to read.
A useful first exercise is rebuilding a sheet that was designed for printing into one designed for calculating. Take a workbook with a separate sheet for every month and stack the months into one long table, with a Month column to tell them apart. Split an entry like "5 kg" into a number column holding 5 and a unit column holding kg. Then click any cell inside the data and press Ctrl+T. The resulting Excel Table gets a name, filter buttons on every header, and formulas that extend to new rows on their own.
A worksheet offers 1,048,576 rows and 16,384 columns, so space is never a reason to scatter data across sheets. A good sign that tabular thinking has stuck: from any header, Ctrl+Down Arrow lands exactly on the last record, with no blank row stopping it halfway.
Data entered in tabular form from the start lets every later formula, filter and PivotTable work without repairs.