Forum Discussion
Need to calculate based on values from two separate drop down Lists
Without seeing your actual workbook, it's hard to be sure. I do notice that the first argument in your VLOOKUP formula is itself an array, and my own suspicion would be that that might be the problem. Usually one uses a single cell as the first argument.
If you were to post your actual sheet, we (I and others) could take a look at it. Just make sure it's not got any confidential info on it
mathetes just getting laptop back thanks so much for response. I've attached sheet
- SergeiBaklanJul 20, 2020Diamond Contributor
That could be
=IFNA(INDEX('Main Sheet'!$A$4:$Q$20, MATCH([@[From ]], 'Main Sheet'!$A$4:$A$20,0), MATCH([@To],'Main Sheet'!$A$4:$Q$4,0)),0)- Amanda535Jul 20, 2020Copper ContributorYou guys are the absolute best! I didnt even try the match thanks so much for you help. Now I'll never forget it
- SergeiBaklanJul 20, 2020Diamond Contributor
You are welcome.
If continue mathetes idea, you may name range with Mileage Matrix let say as MileageMatrix, when formula could be
=IFNA(INDEX( MileageMatrix, MATCH([@[From ]],INDEX(MileageMatrix,0,1),0), MATCH([@To],INDEX(MileageMatrix,1,0),0) ),0)
- mathetesJul 20, 2020Gold Contributor
SergeiBaklanhas given you the formula that handles your initial request. I've tweaked the spreadsheet just a bit more and suggest you not "hard-code" the mileage rate into the formula, as you had it. Instead, create a named range where that rate is called "MileageRate" and then your formulas will just refer to that term. That way, next year, when the rate gets changed (or after you've exceeded the 5,000 Km limit, the rate can be changed at the level of that little table rather than editing each formula.