If Statements with multiple criteria options

osscie3

Board Regular
Joined
Apr 30, 2014
Messages
70
Good morning all,

I'm trying to build a lending price model for my boss. Basically one that can determine the interest rate based on some inputs.

Here are the criteria -

1. Credit score - which I have defined as 720+, 719-690, etc
2. The year the vehicle was made - 2015-2017, 2012-2014, etc
3. The term of the loan - 48, 64-75, etc.

Depending on what each criteria has been selected will determine an interest rate.

Is this something I can do with formulas or am I going to have to write a macro instead? I'm not shy to macros as I've written a few over 1,000 lines of code. It may even be easier to go the macro route. My goal is to make it as simplistic I can for my boss. Thanks for your opinions!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
It really depends upon how all the criteria interact with each other and how many levels of each that you have.
Can you explain, in plain English, that given those three criteria, how you would determine the rate now?
 
Upvote 0
Absolutely. Luckily, it's a pretty straightforward table. The only problem is, it has 3 criteria in it rather than just 2 columns. So for example, the table is laid out as follows - (I'm putting in dummy interest rates as it's proprietary)

Auto YearTerm720+719-690689-640 600-639
2015-17up to 481.00%2.00%3.00%4.00%
2015-1749-631.10%2.10%3.10%4.10%
2015-1764-751.20%2.20%3.20%4.20%
2012-14Up to 481.30%2.30%3.30%4.30%
2012-1449-631.40%2.40%3.40%4.40%

<tbody>
</tbody>

Etc, etc. So it's taking the auto year, then term, then the credit score to produce an interest rate.
 
Last edited:
Upvote 0
Hmmm...

This could be a little tricky. Here is how I would approach it:

Since all your criteria are "ranges of values" instead of single values, for each of your three criteria, write a VLOOKUP to return the range.
So would create three lookup tables, where the first column is the lower limit of each range and the second column is the range value, and sort it by the first column.

For example, your year lookup table may look something like this:
Code:
Lower Limit     Range
2006            2006-08
2009            2009-11
2012            2012-14
2015            2015-17
Then, if we named this range "YearRange" (see this if you do not know how to name ranges: http://www.contextures.com/xlNames01.html), we would use this VLOOKUP formula to return which range a year falls into (for a value in cell A1):
Code:
=VLOOKUP(A1,YearRange,2,TRUE)
So, do likewise for the other two criteria.

Then, create a BIG lookup table of all your different combinations, and use an INDEX/MATCH function to match on all three range criteria, as shown here:
https://exceljet.net/formula/index-and-match-with-multiple-criteria
 
Upvote 0
My biggest concern when taking on a project like this, is who is going to maintain the spreadsheet.

ABCDEF
1Criteria
2Auto Year2015-17
3Term49-63
4Credit Score689-640
5Rate
3.10%
6
7Auto YearTerm720+719-690689-640600-639
82015-17up to 481.00%2.00%3.00%4.00%
92015-1749-631.10%2.10%3.10%4.10%
102015-1764-751.20%2.20%3.20%4.20%
112012-14Up to 481.30%2.30%3.30%4.30%
122012-1449-631.40%2.40%3.40%4.40%

<tbody>
</tbody>

Formula in B5 is an array formula, Use Ctrl+Shift+Enter after typing in the formula, not just Enter.
=INDEX(C8:F12, MATCH(B2 & B3, A8:A12 & B8:B12, 0), MATCH(B4, C7:F7, 0))
 
Upvote 0
Hmmm...

This could be a little tricky. Here is how I would approach it:

Since all your criteria are "ranges of values" instead of single values, for each of your three criteria, write a VLOOKUP to return the range.
So would create three lookup tables, where the first column is the lower limit of each range and the second column is the range value, and sort it by the first column.

For example, your year lookup table may look something like this:
Code:
Lower Limit     Range
2006            2006-08
2009            2009-11
2012            2012-14
2015            2015-17
Then, if we named this range "YearRange" (see this if you do not know how to name ranges: http://www.contextures.com/xlNames01.html), we would use this VLOOKUP formula to return which range a year falls into (for a value in cell A1):
Code:
=VLOOKUP(A1,YearRange,2,TRUE)
So, do likewise for the other two criteria.

Then, create a BIG lookup table of all your different combinations, and use an INDEX/MATCH function to match on all three range criteria, as shown here:
https://exceljet.net/formula/index-and-match-with-multiple-criteria

Ok so I've set up my vlookups, rearranged my table to make it a little more computer friendly as follows -

720+
2015 - 2017
Up to 48
1.00%
720+
2015 - 2017
49 - 63
2.00%
720+
2012 - 2014
Up to 48
3.00%
720+
2012-2014
49 - 63
4.00%

<tbody>
</tbody>
Etc.

I'm getting a VALUE error in my index match formula and now I'm stuck. Trying to debug but I'm not as familiar with the debug process on the front end. I tried formatting everything in my table to be the same. The values in my vlookups vs my table seem to be an exact match (I've tried different combinations to ensure it's not one column of my table throwing it off). My formula is -
Code:
[=INDEX(Sheet3!L24:L76,MATCH(1,(Sheet3!U12=Sheet3!I24:I76)*(Sheet3!U13=Sheet3!J24:J76)*(Sheet3!U14=Sheet3!K24:K76),0))/CODE]

I clicked on "Show Calculation Steps" and it underlines Sheet3!I24:I76. Right before that, it displays "720+" which tells me it's getting U12. So it's something with the columns in my table. Maybe I should format my table as a table rather than just raw data?

Disregard, I did what thisoldman suggested at the end hit Control+Shift+Enter and it worked beautifully.

Thanks for everyone's help!
 
Last edited:
Upvote 0
720+2015 - 2017Up to 483.00%
720+2015 - 201749 - 634.00%

<tbody>
</tbody>
Spoke too soon. So it will return a rate. It's just not the correct rate. It returns the interest rate directly below correct one. Example if the user has 720 credit, year of car is 2015, and term is 40. It should look at the table above and display the 3% rate, however it displays 4% instead. No idea why. Thoughts?
 
Upvote 0

Forum statistics

Threads
1,215,160
Messages
6,123,355
Members
449,097
Latest member
thnirmitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top