I have a mileage matrix with all the locations across the top and down the side. On another sheet I have a stockout sheet, and I want to find the three nearest locations to the ones that are stocked out.
So, if I have a stockout (=IF(B3<0,.....) I want to go to the mileage matrix, find that location in the matrix (VLOOKUP or MATCH?), look down the row to find the lowest mileage (SMALL) and then at the top of that column is where my nearest location is (function??). In subsequent columns I want the second nearest location (SMALL(x,2)) and the third nearest location (SMALL(x,3)).
In parentheses I've indicated the formulas I've been playing with to try to afford this goal. I think this might be a little more complex than what I'm used to....
Maybe I am going about it in completely the wrong way. Any ideas?
So, if I have a stockout (=IF(B3<0,.....) I want to go to the mileage matrix, find that location in the matrix (VLOOKUP or MATCH?), look down the row to find the lowest mileage (SMALL) and then at the top of that column is where my nearest location is (function??). In subsequent columns I want the second nearest location (SMALL(x,2)) and the third nearest location (SMALL(x,3)).
In parentheses I've indicated the formulas I've been playing with to try to afford this goal. I think this might be a little more complex than what I'm used to....
Maybe I am going about it in completely the wrong way. Any ideas?