I have a dataset consisting of approx 200,000 rows. One of the columns is named ProjectNumber, and if I remove the duplicates there is approx 2,000 unique values left. I have a lookup formula to another table with projects, to check if the ProjectNumber exists. I know how to do the lookup formula itself (using MATCH), but the formula takes 7 seconds to finish up checking every of the 200,000 rows. In comparison, when I remove the duplicates, and check only the 2,000 remaining rows, the formula takes less than 0,1 seconds. (I'm using a RangeTimer macro to measure the time.) So, my worksheet with all the 200,000 rows is very slow :/
I know how to remove the duplicates, but I'm making this sheet for others to use, and I would like an error message to be displayed in the table with the 200,000 rows. I only need one of the rows with a non existing ProjectNumber to display the error message.
So, my question is this: Is there any formula that can do a lookup for the ProjectNumber, but if the same ProjectNumber already has been checked, then the formula should do nothing. So basically, I need a formula that checks a duplicate value only once.
What I have tried:
Any ideas?
I know how to remove the duplicates, but I'm making this sheet for others to use, and I would like an error message to be displayed in the table with the 200,000 rows. I only need one of the rows with a non existing ProjectNumber to display the error message.
So, my question is this: Is there any formula that can do a lookup for the ProjectNumber, but if the same ProjectNumber already has been checked, then the formula should do nothing. So basically, I need a formula that checks a duplicate value only once.
What I have tried:
- IF(ROW([@ProjectNumber])-1=MATCH([@ProjectNumber],[ProjectNumber],0),"Lookup","Do not lookup")
This formula only does a lookup if the row number equals the row where the ProjectNumber first appears. However, the MATCH part is doing what I'm trying to avoid in the first place, by checking the entire 200,000 rows, for each row. So, this formula also slows Excel down.
Any ideas?