Find the last entry in your table with a simple, smart formula

Finding the column of the last "X" in your Excel table can streamline your calculations significantly, especially when dealing with variable opening hours.

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

We read the post from Yento18 with a mix of recognition and frustration, recognition because this is exactly the kind of problem that trips up smart people working with traditional spreadsheets, and frustration because the solution should not require a workaround that feels like a puzzle. The question is straightforward: find the last entry in a row of time-slot columns, then calculate the duration. The fact that it requires a nested `MATCH` inside a `ROUNDUP` of a `FLATTEN` of a `TRANSPOSE` is not a sign of cleverness; it's a sign that the tool is getting in the way.

The user's approach is logical. They know they need the column index of the last `X` and the first `X`, then subtract. They found a formula for the first `X`. The gap is the last `X`. In Excel, the natural reflex is to reach for `LOOKUP` or `MAX` with `COLUMN`, but when your data spans multiple rows and you cannot reshape the table, the formulas become brittle. The deeper issue here is that the user is spending mental energy on formula gymnastics instead of the actual homework: understanding opening hours. That is the real cost of legacy tools, they force you to become a technician before you can be an analyst.

What this story underscores is that the problem is not the user's logic. It is the absence of a function that says, "give me the position of the last occurrence in this range." Spreadsheet formulas were designed for static, rectangular data. When your data is irregular, different start times, variable number of marks, you are essentially writing a small program in a language that was never meant for it. The user is not asking for something exotic. They are asking for a basic operation that should be one function call, not a chain of six.

Our opinion is plain: if you find yourself nesting more than three functions to answer a simple question about your data, you are fighting the tool, not using it. The solution exists, AI-native spreadsheets can interpret intent, flatten irregular tables, and return the last occurrence without requiring the user to become a formula architect. The user's time is better spent on the problem they actually care about. That is the shift we advocate: tools should meet you where you are, not make you climb a mountain to ask a simple question.

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

For one of my homework, I have to calculate multiple things on this table with only Excel formula. One of the things that I have to calculate is the opening time (how long this place is open) and because there's sometimes multiple X in a columns or it doesn't alwalys start at 8am (8h) and close at 5pm (17h), so I can't just count all the X or smthg like that... So I tought that I could just find the columns of the first and last X and just compare them after but I can't manage to find a formula…

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