Sort smarter with IF to remove zeros from your multi-sheet date list

If you're looking to create a sorted list of dates from two separate sheets without cluttering it with zeros, you're in the right place.

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

This is a smart question that gets to the heart of a real workflow problem, and the answer is more elegant than you might expect. The user is dealing with two client sheets that will grow over time, and they want a single sorted list of dates without the clutter of thousands of blank cells showing up as zeros. The instinct to use `IF` is understandable, but it will lead to a nested mess. There is a cleaner path.

The practical solution is to wrap the `VSTACK` output in a `FILTER` function before sorting. Instead of `=SORT(VSTACK('CLIENT A'!A2:A100000,'CLIENT B'!A2:A100000))`, try `=SORT(FILTER(VSTACK('CLIENT A'!A2:A100000,'CLIENT B'!A2:A100000), VSTACK('CLIENT A'!A2:A100000,'CLIENT B'!A2:A100000)<>0))`. This tells the spreadsheet to build the combined list, then keep only the cells that are not zero, and finally sort the result. No `IF` statements, no helper columns, no manual trimming. It is a single formula that scales automatically as new dates are added.

What this means for you is that you can stop worrying about blank cells polluting your output. The zeros are not malicious; they are just how empty cells behave when forced into a numeric operation. By filtering them out at the source, you get a clean, dynamic list that always reflects exactly what you need. This approach also keeps your workbook maintainable. If you later add a third client sheet, you update the `VSTACK` references once and the formula adapts. No need to revisit the logic. The real power here is not in avoiding zeros, but in building a system that handles growth without manual intervention. That is the kind of thinking that transforms a spreadsheet from a static document into a living tool.

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

I am attempting to get a sorted list of dates from 2 separate sheets that will be added to (why it's A2:A100000). I don't want nearly 200,000 zeros in this list. Can I use =IF or another, more slick function to do so?

=SORT(VSTACK('CLIENT A'!A2:A100000,'CLIENT B'!A2:A100000))

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