Sunday, January 23, 2022

HP 17BII+ and Numworks: Payment of a Loan with an Unusual First Period

 HP 17BII+ and Numworks: Payment of a Loan with an Unusual First Period


The First Payment Is Not Due in a Month

In finance, the first payment of a loan is not due at the end of a month from signing. This happens when all payments are due at a certain date, such as the 30th/31st or 1st of each month, regardless of when the loan papers are signed.  Loans of this type are referred to odd period loans or partial period loans.  Every payment after the first follows the conventional month time line.


HP 17BII+ Formula:  Partial Period Loan 

The following HP 17BII+ formula deals with calculating odd period loans.  This solver formula is directly from the HP 17BII+ Financial Calculator User's Guide, pg. 196 (see source):

ODD:  PV×(I%÷100×FP(DAYS÷30)+1)=-IF(DAYS<30:(1+I%÷100)×PMT:PMT)×UPSV(I%:N)-FV×SPPV(I%:N)

In the solver, the percent sign is a character used in variables, not a function.  PV, FV, PMT, I%, N are all valid variables in the HP 17BII+ solver.  The variables:

N:  number of payments
DAYS:  number of days in the first period, from 0 to 59.
I%:  the periodic interest rate.   For monthly payments, divide the annual interest rate by 12.
PV:  the loan amount
FV:  the balloon amount
PMT:  payment

This formula follows the cash flow convention:  negative amounts for cash outflows, positive amounts for cash inflows.


Numworks Script:  Partial Period Loan
oddperiod.py


# 2021-11-14 EWS
# odd period

from math import *

print("Loan with partial period")
print("0 - 59 days")
print("Monthly Payments")
n=float(input("N: n? "))
rate=float(input("I/YR:  rate? "))
pv=float(input("PV: loan amt? "))
fv=float(input("FV: balooon pmt? "))
days=float(input("DAYS: odd period? "))

r=rate/1200

if days<30:
  j=1+r
else:
  j=1

f=days/30-int(days/30)
w=r*f+1
  
# uspv
u=(1-(1+r)**(-n))/r
# sppv
s=(1+r)**(-n)


pmt=(pv*w+fv*s)/(j*u)
# rounding
pmt=-int(pmt*100+.5)/100
# result
print("Payment: "+str(pmt))

Note:   the cash flow convention is followed


Examples

Loan 1:
Inputs:
N = 60
DAYS = 10
PV = $58,425.10
I%/YR = 4.48%  (annual rate), for the HP 17BII+, divide this by 12
FV = $0.00 (no balloon payment)

Result:  PMT:  -1,085.99  


Loan 2:
Inputs:
N = 240
DAYS = 40
PV = $16,956.00
I%/YR = 7.02%  (annual rate), for the HP 17BII+, divide this by 12
FV = $500.00 (enter -500.00 for HP 17BII+)

Result:  PMT:   -130.96


Source

HP 17BII+ Financial Calculator User's Guide.  Ed. 2.  Hewlett Packard.  San Diego, CA  2004


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Spotlight: Sharp EL-5200

  Spotlight: Sharp EL-5200 As we come on the 13 th (April 16) anniversary of this blog, I want to thank you. Blogging about mathematic...