Below are 3 user-defined-functions (UDFs).
The first, I would use to replace your current "last_cell_value". It is slightly less flexible than "last_cell_value" in that is assumes you are always interested in a single column. (If I understand your needs, this is correct.) On the other hand, it is more flexible in that it allows for more than 50,000 rows of data; so it will be useful when you move to Excel2007.
The next two UDFs build off of the first. They find the date associated with the last row of data (for a given column), then back up 7 days or 1 month. If there is no exact match (for example, if that date was a holiday), it returns the data from the previous row. (If you want to make that the next row down instead of up, change the 1 to -1 in the "Match" statement.)
Examples:
=Last_Row_value(Sheet2!$B:$B)
=Last_week_value(Sheet2!$B:$B)
=Last_month_value(Sheet2!$B:$B)
Bookmarks