|BTW...this is not directly related to your question...it's just a suggestion about your VLOOKUP formula.|
The IFERROR function was introduced in Excel 2007. This makes writing VLOOKUP formulas a little easier:
This formula will return the empty string if the lookup_value isn't found in the lookup_table.
Now for the downside of using IFERROR:
The standard method, using = IF(ISNA...) directly checks for the ISNA error returned by VLOOKUP. The IFERROR function looks for any error related to the VLOOKUP.
The implication of this in your case is as follows:
There are 2 possible errors that that formula can produce: #N/A and #NAME. Your formula will handle the #N/A error and return the empty string, but if the Named Range "Dates" doesn't exist, it will return the #NAME error. That's a good thing since you'll know that you are referencing an invalid range.
The IFERROR function will return the empty string for both of those errors but you will not know why. Let's take the situation where the user thinks he created the named range but forgot. When the IFERROR returns the empty string, he might think it's because the lookup_value doesn't exist. That's not a good thing.
So, considered yourself warned ;-). IFERROR can save some typing, but it does have some inherent dangers.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.