Search code examples
excelif-statementmaxexcel-2010array-formulas

Multiple same values in Column A, need to find the greater date in column B


I'm stumped on a particular problem with some data that's imported to me. I have zero control over how the data is coming in. (Just to clarify that point).

I have two columns and 107,000 rows.

Column A has an ID#, Column B has the corresponding Date.

The issue I have is that Column A can have multiple identical values, and the corresponding date value in Column B has different or same dates.

I'm looking to add column C with a way to look up the cell in Column A, check it against the rest of column A, find any matches, and then return the Max/most recent date from column B for that ID#.


Solution

  • Please try:

    =MAX(IF(A:A=A1,B:B))  
    

    entered with Ctrl+Shift+Enter and copied down to suit.

    I'm afraid this could be quite slow.

    I did not limit the range because I assumed 107,000 rows was an approximation. However this is slow even for 1,000 rows, so for emphasis I repeat part of @XOR LX's comment:

    Even reducing the number of rows being referenced by a factor of 10 will have a significant improvement on calculation speed.