My SQL query is not very complex. LeftOverMonthlyIncome is a variable calculated in the spreadsheet.
SELECT CounterOfferLineAmount
FROM CounterOfferLine
WHERE MinLeftOverIncomeAmount <= LeftOverMonthlyIncome
AND MaxLeftOverIncomeAmount >= LeftOverMonthlyIncome
Basically, "Give me the CounterOfferLine where LeftOverMonthlyIncome is between MinLeftOverIncome and MaxLeftOverIncome".
I've defined a table in Excel that has this structure:
MinLeftOverIncomeAmount __MaxLeftOverIncomeAmount __CounterOfferLineAmount<br/>
0__________________________30___________________0
30_________________________35___________________600
35_________________________40___________________700
40_________________________45___________________800
45_________________________50___________________900
50_________________________55___________________1000
If LeftOverMonthlyIncome is 43 then the CounterOfferLine should be 800 (43 >= 40 and 43 <= 45 that equates to 800)
How do I convert this into an Excel function? Is this a VLookup, Lookup, If, AND, Match, Index?