Count across columns without rebuilding your pivot table every month

Are legacy pivot tables holding you back from accurately counting complex data sets?

3 min readMicrosoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

The problem this user describes is the exact moment when a spreadsheet stops being a tool and starts being a chore. Counting procedures across columns, separating inpatient from outpatient, and swapping data sets every month without rebuilding formulas, that is not a workflow. That is a recurring penalty for using a system that was never designed for this kind of analysis. The pivot table, so often the hero of data work, fails here because the data structure is wide, not tall. And when the pivot table fails, the fallback is a tangle of COUNTIFS that breaks the moment you change a worksheet name.

We think this user is asking the right question, but for the wrong tool. The instinct to make Excel work harder is understandable, it is what most of us have been trained to do. But the real solution is not a better formula. It is a data model that understands that one patient can have multiple procedures, and that those procedures live in separate columns only because the original spreadsheet was designed for human eyes, not for computation. When you have to count "PCI" wherever it appears across three or four columns, and then split those counts by inpatient status, you are essentially asking Excel to become a relational database. It can do it, but only with heroic effort and fragile formulas.

What this user needs is a tool that lets them normalize that data without manual intervention. An AI-native spreadsheet can unpivot those procedure columns automatically, turning a wide row into multiple rows, one per procedure. Once the data is long instead of wide, a pivot table works perfectly. Inpatient and outpatient splits become trivial. Combining "LEFT HEART CATH" and "LEFT HEART CATH W/GRAFTS" becomes a simple grouping rule, not a nested IF statement. And swapping in next month's data? That becomes a one-click refresh, not a formula rewrite.

The user is not asking for a miracle. They are asking for a tool that respects the shape of their data. That is a reasonable request, and it is one that legacy spreadsheets have never answered well. The future of data work is not about mastering more obscure functions. It is about using tools that understand your intent. Count the procedures, separate the settings, automate the refresh. That should be the baseline, not the bonus.

From Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Hello. I'm working in M365. I have a report I need to produce monthly. I'm hoping to be able to swap out this month's data set for the next and not have to re-create the wheel each time.

I need help figuring out how to count values that occur in multiple columns. I'm a big fan of pivot tables, but unfortunately it doesn't seem accurate for this particular data set.

Read the original at Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community