There is a moment in every spreadsheet project when the data stops being rows and starts being a puzzle. That is where this user finds themselves, staring at 62,000 lines of pickup and dropoff records, trying to extract a single clean number. The request is simple on its face: count each unique origin-destination pair once, but only when that origin has money attached, and only on the first appearance. The fact that this person has tried ROW, UNIQUE, FILTER, COUNTIFS, and even resorted to asking AI tells us something important. The tools are not the problem. The approach is.
What makes this hard is not the volume. Spreadsheets handle 62,000 rows without breaking a sweat. The difficulty is in the logic of "first time the pickup and dropoff location appears." That phrase sounds like a filter, but it is actually a ranking problem. You need to identify, within each group of repeated pairs, which row comes first. That is not a COUNTIF. That is a MINIFS or a SORTN or a helper column that flags the earliest instance. Once you have that flag, the rest is a simple SUMIFS or COUNTIFS on the origin and the money condition. The user is close. They just need to shift from counting directly to staging the data with a helper column.
Here is what we think this means for anyone facing a similar wall. Stop trying to solve the whole problem in one formula. Break it into steps. Add a column that marks whether a row is the first occurrence of its pair. Use a formula that compares the current row to the minimum row number for that pair, something like `=COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2)=1`. That gives you a TRUE or FALSE. Then your summary tab simply counts rows where that flag is TRUE, the origin matches, and the money column is populated. It is not glamorous. It is not a single array formula that does everything at once. But it works, and it is transparent. Anyone who opens your file can follow what you did.
The deeper lesson here is about how we think about spreadsheet complexity. Most people assume that a hard problem requires a more clever formula. In reality, it usually requires a more honest structure. The data is not asking for magic. It is asking for a clear definition of what "first" means and a place to store that decision. The user has already done the hard part by articulating the rule. They just need permission to use a helper column and stop forcing everything into one cell. That is not a workaround. That is good spreadsheet design. And it is the difference between wrestling with 62,000 rows and simply asking them to line up in order.