HELP: Excel Formula using date as basis for interest

rcomag

New Member
Joined
Aug 23, 2019
Messages
37
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Hello, newbie here. can someone please help on how to work on the formula using dates (year... if possible movable dates) as basis for computing the interest. i made a formula and i cant seem find anyway to have the year be moving, depending on the present year, or if possible to include the months for the computation of interest. thank you.

=IF(O13>=2020,R13*-20%, IF(O13=2019,R13*24%, IF(O13=2018,R13*48%, IF(O13>=1992,R13*72%, IF(O13>=1974, R13*24%, IF(O13<=1973, R13*12%))))))

:biggrin::biggrin::biggrin:
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi rcomag,

I understand your formula and can reproduce:


LMNOPQR
13108019961500

<tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
L13=IF(O13>=2020,R13*-20%, IF(O13=2019,R13*24%, IF(O13=2018,R13*48%, IF(O13>=1992,R13*72%, IF(O13>=1974, R13*24%, IF(O13<=1973, R13*12%))))))

<tbody>
</tbody>

<tbody>
</tbody>


My preferred solution would be to use a table of years and percentages then use VLOOKUP

LMNOPQR
1YearInterest
2012%
3197312%
4197424%
5199272%
6201848%
7201924%
82020-20%
9 to12
1324.00%19821500

<tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
N13=VLOOKUP(O13,$L$2:$M$8,2,TRUE)

<tbody>
</tbody>

<tbody>
</tbody>



The VLOOKUP says, take the contents of O13 and look in L2 to L8. If you find a match then retrieve from that row the value in the second column of my search (L2 to M8 so value retrieved from column M).
The TRUE says find an approximate match, so the years in column L must be ascending and if it doesn't find an exact match then it returns the year which is highest which is equal or below the search value.

My table must start with a year zero, or the lowest possible year, so I catch those entries in O13
 
Upvote 0
thank you for your help.. tried the solution you gave and it work. can the return be multiplied directly to another cell instead of the interest rate and can present date be incorporated in the formula??? interest rates are increasing monthly at a rate of 2% monthly up to 3 years, 72% or 36 months (3 years). thank you very much.
 
Upvote 0
rcomag,

"can the return be multiplied directly to another cell instead of the interest rate"
Yes. If I change the format of cell N13 from percentage to a number then
=R13*VLOOKUP(O13,L2:M8,2,TRUE)
will return 360.00, being 24% of 1500


"can present date be incorporated in the formula?"
If you change the VLOOKUP list from year to date then you can also use an input date.

LMNOPQR
1YearInterest
201-Jan-0012%
306-Jun-7312%
403-Mar-7424%
506-Jun-9272%
604-Apr-1848%
706-Jun-1924%
827-Jul-1930%
924-Aug-1950%
1001-Jan-20-20%
11
12
13360.0001-Jan-821500
14450.0028-Jul-191500
15750.0025-Aug-191500

<tbody>
</tbody>
Sheet3 (2)

Worksheet Formulas
CellFormula
N13=R13*VLOOKUP(O13,$L$2:$M$10,2,TRUE)
N14=R14*VLOOKUP(O14,$L$2:$M$10,2,TRUE)
N15=R15*VLOOKUP(O15,$L$2:$M$10,2,TRUE)

<tbody>
</tbody>

<tbody>
</tbody>

Here my original row 13 result is unchanged.

The new row 14 is a 28 July 2019 date. One day after the 27 July 2019 increase to 30%.

Row 15 shows that today I'd get the new rate entered yesterday of 50%.
 
Upvote 0
hello again, can i incorporate these table of penalties to the vlookup formula??
YEAR amount interest penalty
2002 707.00 0.72 509.04
2018 174.80 0.48 83.90
2019 300.00 0.24 72.00




<colgroup><col span="2"><col><col><col></colgroup><tbody>
</tbody>
TABLE OF PENALTIES
januaryfebruarymarchaprilmayjunejulyaugustseptemberoctobernovemberdecember
197312%12%12%12%12%12%12%12%12%12%12%12%
197424%24%24%24%24%24%24%24%24%24%24%24%
199272%72%72%72%72%72%72%72%72%72%72%72%
201750%52%54%56%58%60%62%64%66%68%70%72%
201826%28%30%32%34%36%38%40%42%44%46%48%
2019-10%-10%-10%8%10%12%14%16%18%20%22%24%
2020-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%
if your due is year 2018 and you paid it in june, you get a penalty of 36%.
if your due is 2017 and you paid it in october, you get a penalty of 68%.
if your due is 2019 and you paid it in february, you get a discount of 10%.

<colgroup><col span="2"><col><col><col><col span="8"></colgroup><tbody>
</tbody>


thanks!!!1

:)
 
Upvote 0
Hi rcomag,

It's easier to stick with the original two column VLOOKUP and you can extend those columns down as many rows as you like (as long as the formulae also look down to the maximum row).

You don't say how the paid date is entered so again I'll assume a full date.

You've taken away the pre-1973 row so I'll wrap the formula in an IFERROR and return zero if an earlier date is selected.

It is possible to do it with VLOOKUP but it gets very messy. Your example data doesn't show it but what if they pay June 1993? VLOOKUP returns the 1992 row and you could select the column related to the month but June 1992 might be at a different rate than December 1992, which is the closest earlier date with data.

I'd change to use INDEX and MATCH to select from that array:

ABCDEFGHIJKLM
1TABLE OF PENALTIES
2januaryfebruarymarchaprilmayjunejulyaugustseptemberoctobernovemberdecember
3197312%12%12%12%12%12%12%12%12%12%12%12%
4197424%24%24%24%24%24%24%24%24%24%24%24%
5199272%72%72%72%72%72%72%72%72%72%72%72%
6201750%52%54%56%58%60%62%64%66%68%70%72%
7201826%28%30%32%34%36%38%40%42%44%46%48%
82019-10%-10%-10%8%10%12%14%16%18%20%22%24%
92020-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%
10.....................................
11Date PaidPenaltyAmountPenalty
1206-Jun-1836%1500540.00
1301-Oct-1768%15001020.00
1402-Feb-19-10%1500-150.00
1502-Feb-9372%15001080.00
1601-Jan-21-20%1500-300.00
1701-Jan-450%15000.00
1803-Mar-0272%707509.04

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
E12=IFERROR(IF(ISNA(MATCH(YEAR(D12),$A$3:$A$9,0)),INDEX($M$3:$M$9,MATCH(YEAR(D12),$A$3:$A$9,TRUE)),
INDEX($B$3:$M$9,MATCH(YEAR(D12),$A$3:$A$9,0),MONTH(D12))
),0
)
G12=F12*E12

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
hello again, thank you for helping me.. tried your formula but couldn't still figure it out. anyways, here is what i've tried doing. i still can't get the right interest rate.



August 26, 2019
10,153.04
TABLE OF PENALTIES
`
interest RATEcorrect januaryfebruarymarchaprilmayjunejulyaugustseptemberoctobernovemberdecember
PAYABLEYEARSAMOUNTfrom formulainterest rateINTERESTTOTAL197312%12%12%12%12%12%12%12%12%12%12%12%
252,470.0020192019 2,524.70 0.16 16% 403.95 2,928.65197424%24%24%24%24%24%24%24%24%24%24%24%
23,640.0020182018 236.40 0.16 40% 94.56 330.96199272%72%72%72%72%72%72%72%72%72%72%72%
23,640.0020172017 236.40 0.16 64% 151.30 387.70201750%52%54%56%58%60%62%64%66%68%70%72%
23,640.0020012016 3,782.40 0.16 72% 2,723.33 6,505.73201826%28%30%32%34%36%38%40%42%44%46%48%
2019-10%-10%-10%8%10%12%14%16%18%20%22%24%
TOTAL 6,779.90 3,373.14 10,153.042020-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%
FORMULA THAT I USE:
=IFERROR(IF(ISNA(MATCH(YEAR($Q$10),$AB$19:$AB$25,0)),INDEX($AB$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,TRUE)),INDEX($AC$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,0),MONTH(TODAY()))),0)

<colgroup><col><col><col><col><col span="3"><col><col><col><col span="12"></colgroup><tbody>
</tbody>

Q10 refers to the date, august 26, 2019

couldn't figure how to use the payable years as basis for the interest aside from as to the date of payment.
thanks.....

<colgroup><col><col><col><col><col span="3"><col><col><col><col span="12"></colgroup><tbody>
</tbody>
 
Upvote 0
First let me advise you remove the IFERROR while testing as it masks most errors and is only there if you enter a date before 1973.


I'm not sure I understand what you're trying to achieve in those first 8 columns.

The original request was to find a % for a list of years given a specific year and if not present pick the latest % before the given year. I confirmed VLOOKUP would work and provided an example.

The 1st revision said interest rates change monthly so you want multiple entries for a year. I advised the same 2 column solution worked if you showed change year as change date and the given year changed to a given date.

The 2nd revision asked that a table by year with months be used instead of a list. I advised INDEX and MATCH would be preferred over VLOOKUP and demonstrated with a worked example. Let me split that solution into its component parts, using the rows and columns from your latest example:

The IFERROR is only there to capture dates earlier than 1973 so let me remove it.


  • =IF(ISNA(MATCH(YEAR($Q$10),$AB$19:$AB$25,0)),
    Checks for an exact match of the year in the table. If there's no exact match then we know we should use December values from the previous year listed.
  • INDEX($AN$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,TRUE)),
    This executes if no exact match of the year was found so it INDEXes into column AN (December values) for an earlier year using does a MATCH with TRUE (e.g. a 1996 year will return the row for 1992 so I get the 1992 %)
  • INDEX($AC$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,0),MONTH($Q$10)))
    This executes if an exact match of year was found so we know we'll have year and month in the table. It looks at all rows and columns in the array and selects the row matching on year and the column relating to the given month (e.g. a date of any June 1992 day will match the 3rd row and go to the 6th column, so retrieving 72% from AH21.



Looking at your formula after removing IFERROR for testing:

  • =IF(ISNA(MATCH(YEAR($Q$10),$AB$19:$AB$25,0)),
    Same as my formula.
  • INDEX($AB$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,TRUE)),
    This executes if an exact year is not found. Here you're INDEXing into an array of rows 29 to 35 and columns AB to AN but only specifying a row number so you will get a #REF error.
  • INDEX($AC$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,0),MONTH(TODAY())))
    This executes when an exact year match is found but the column it uses for month is based on TODAY's date, not the entered date.
 
Upvote 0
hello again, sorry if i cannot fully express what i am trying to do, here is what i did after using the formula. the interest rate from FORMULA for 2018 is 16% as per year and date (reference month) when it should be 40% as per year and month with reference to the table. same with 2017 which is 16% but should be 64%. looking at the formula, only the reference month is included, the reference year is not. could the reference year and reference month be used in the computation. thank you


REFERENCE MONTH
August 27, 2019
10,153.04
REFERENCE TABLE
INTEREST RATE as to year due and date of payment AS PER TABLE
`correct interest rate for year payment and as date of payment
interest RATE januaryfebruarymarchaprilmayjunejulyaugustseptemberoctobernovemberdecember
REFERENCE YEAR AMOUNTfrom FORMULAINTERESTTOTAL197312%12%12%12%12%12%12%12%12%12%12%12%
252,470.0020192019 2,524.70 0.16 16% 403.952,928.65197424%24%24%24%24%24%24%24%24%24%24%24%
23,640.0020182018 236.40 0.16 40% 94.56 330.96199272%72%72%72%72%72%72%72%72%72%72%72%
23,640.0020172017 236.40 0.16 64% 151.30 387.70201750%52%54%56%58%60%62%64%66%68%70%72%
23,640.0020012016 3,782.40 0.16 72% 2,723.336,505.73201826%28%30%32%34%36%38%40%42%44%46%48%
2019-10%-10%-10%8%10%12%14%16%18%20%22%24%
TOTAL 6,779.903,373.1410,153.042020-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%-20%
=IFERROR(IF(ISNA(MATCH(YEAR($Q$10),$AB$19:$AB$25,0)),INDEX($AB$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,TRUE)),INDEX($AC$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,0),MONTH(TODAY()))),0)
=IF(ISNA(MATCH(YEAR($Q$10),$AB$19:$AB$25,0)),INDEX($AB$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,TRUE)),INDEX($AC$19:$AN$25,MATCH(YEAR($Q$10),$AB$19:$AB$25,0),MONTH(TODAY())))





<colgroup><col><col><col><col><col span="2"><col><col><col><col><col span="12"></colgroup><tbody>
</tbody>
 
Upvote 0
@rcomag
Please do not post the same question multiple times. Questions of a duplicate nature will be locked or deleted, per #12 of the Forum Rules and points 6 & 7 of the Forum Use Guidelines.

Note that posts from new members are sometimes 'held back' until they are approved by a moderator. That had happened with the above post (& the 4 extra copies you made, and one a day or so ago) and you would have been presented with a message to that effect. So in future, please look out for such messages and in any case be patient!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,178
Members
448,871
Latest member
hengshankouniuniu

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