Excel Formula Optimisation

前端 未结 3 1487
说谎
说谎 2021-01-16 08:09

I am no excel expert and after some research have come up with this formula to look at two sets of the same data from different times. It then displays new entries that are

3条回答
  •  终归单人心
    2021-01-16 08:28

    Well, I was playing around a bit and I think that this works the same, and without the first IF statement:

    =IFERROR(INDEX(A$1:A$2500,SMALL(IF(ISNA(MATCH($A$1:$A$2500&$B$1:$B$2500,List1!$A$1:$A$2500&List1!$B$1:$B$2500,0)),ROW($B$1:$B$2500)-ROW($B$1)+1),ROWS(F$2:F2))),"")
    

    That part in your sample data:

    ROWS(F$2:F2)<=(SUMPRODUCT(--ISNA(MATCH($A$1:$A$2500,List1!$A$1:$A$2500,0))))
    

    As I understood it, it only sees to it that the row number in which the formula is entered is lower than the number of 'new' items, but it doesn't serve any purpose because when you drag the formula more than required, you still get errors instead of the expected blank. So I thought it could be removed altogether (after trying to substitute it with COUNTA() instead) and use an IFERROR() on the part directly fetching the details.

    EDIT: Scratched that out. See barry houdini's comment for the importance of those parts.

    Next, you had this:

    ROW($B$1:$B$2500)-ROW($B$1)+1
    

    -ROW($B$1)+1 always returns 0, so I didn't find any use to it and removed it altogether.

    It's still quite long and takes some time I guess, but I believe it should be faster than previously by a notch :)

提交回复
热议问题