The best solution to this depends on many conditions. Among those are:
What type of data is in the range, is it text or numeric, or can it be both?
Are there any empty/blanks cells *within* the range?
Are there any formulas in the range that might return formula blanks?
As a starting point you can try something like this. Assumes no empty/blank
cells within the range:
There are formulas in the cells above. The formulas results in a number
based upon the "If" condition in the formulas, else it returns a blank value
in the cell. Here is a sample of one of the formulas in a cell in the column
above...
The way that LOOKUP works is if the lookup_value is greater than all the
values in the lookup_vector it will match the *last* value in the
lookup_vector that is less than the lookup_value.
To ensure that the lookup_value is greater than all the values in the
lookup_vector we use an arbitrary number that is guaranteed to meet this
condition. In this case the lookup_value is 1E100, 1 followed by 100 zeros.
There's a pretty good chance that no number in your range will be greater
than that so the formula returns the *last numeric* value in the range.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.