Find the last corresponding value that matches lookup value, or use corresponding value of previous lookup value if no match is found:
I am stumped. I have 2 columns, Column B contains averages and Column C contains month numbers. I also have another separate list of sequential month numbers e.g. 4 to 12 (April to December), these are the lookup values.
I want to extract the last average in the B column that corresponds to a given month number in the C column. There can be more than one pair of Average and Month for a given month number and I am only interested in the last one. This average value must then appear next to the corresponding month number in the separate list of sequential month numbers. If however, and this is where the problem lies, there is no corresponding month number in the C column, the average value that must appear next to the month number in the separate list of sequential month numbers must be the average value corresponding to the previous month number that did appear in the C column.
This must be done using formulas. An example of what is required is given at the bottom below.