Showing posts with label taxes. Show all posts
Showing posts with label taxes. Show all posts

Sunday, October 8, 2023

TI-84 Plus CE: Using Matrices for "Tax Table" Calculations

TI-84 Plus CE:   Using Matrices for "Tax Table" Calculations


How The Matrix is Set Up


Each row represents a tier or a bracket.  


First column:  Lower Limit.  This is the test variable.  The first tier often will have the lower tier of 0.


Second and subsequent columns:    Variables that are associated with that tier.


Let's demonstrate this with an example.




Example Tax Bracket






This matrix has four brackets (four rows).  The algorithm starts with the last (bottom) row and tests whether the input is greater or equal to the test variable.  


According to the table, the tax rate changes at income level at $30,000, $90,000, and $270,000, with the top tax rate of 9% effective for all income excess of $270,000.


If the income is $29,999.99, the first tier of 3% is used.  If the income goes to $30,000.00, the next tier is activated.


The program ITAX, which uses this type of setup, goes "backwards".  It tests from the highest tier down.  


For example:  Income = $50,000


Start at tier 4 (bottom row). 

Is 50,000 > 270,000?  No, go to tier 3. (move one row up)

Is 50,000 > 90,000?  No, go to tier 2.  (move one row up) 

Is 50,000 > 30,000?  Yes, use the variables from tier 2.


Tax:  (50,000 - 30,000) × 5% + 900 = 20,000 × 5% + 900 = 1,900


Matrix wise:   (income - M[2,1]) * M[2,2] ÷ 100 + M[2,3]



Programs



There are two programs that illustrate this method:  


ITAX:  Income Tax Bracket.  Bracket is stored in Matrix [ A ] and has three columns:


Column 1:  lower limit of each bracket

Column 2:  tax rate for that bracket

Column 3:  additional "minimum" tax.   



BAROMET:  Calculates the air pressure and density based on height.  Scientific information is stored in Matrix [ J ].  


Column 1:  height in meters

Column 2:  mass density in kg/m^3

Column 3:  standard temperature in K

Column 4:  static pressure in Pa


If you are working in US Units, the height is converted to meters first.  After the calculation, the results are converted back into US units. 



You can download both programs here (zip file):  

https://drive.google.com/file/d/1ZCtMcJgZDLUGnrAHE6cPAkWBQQj1aHKc/view?usp=sharing



Source


"Barometric formula."  Wikipedia.  Last edited July 13, 2023.  Retrieved July 16, 2023.   https://en.wikipedia.org/wiki/Barometric_formula



Eddie



All original content copyright, © 2011-2023.  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. 


Saturday, June 10, 2023

HP 12C Platinum: Property Value by Income and Reversion Method

HP 12C Platinum: Property Value by Income and Reversion Method




Property Valuation



One way to calculate the value of property is by its income and reversion value. 


In this case, the income is the estimated annual net income before taxes which is assumed to be "paid out" at the end of each year.  This income stream is sometimes known as an Inwood annuity cash flow.


The reversion value of a property is its future value based on factors like inflation, anticipated selling price at the end of the project, and the current market value.  The economic life of the property is not necessarily the remaining physical life of the property.   In a time value of money timeline, the reversion value would be received at the end of the project.


Calculating the value of the property using this income method uses three steps, as illustrated by the Board of Equalization (see the Source section below):



1.  Calculate the value of the income stream, called the net income before taxes (NBIT):


PV_income = NBIT ÷ (SFF + yield% + tax_rate%)


where:

SFF = yield% ÷ ((1 + yield%)^n - 1)


yield% and tax_rate% are expressed in decimal form (Example: 0.05 for 5%)


We can use the TVM keys to calculate ((1 + yield%)^n - 1) by setting the following values:


n,  yield → I/YR%, -1 → PV, 0 → PMT, solve for FV.


Then:  SFF = yield% ÷ FV



2.  Value of the reversion value.


PV_reversion = reversion_value × (1 + (yield% + tax_rate%))^(-n)


We can use the TVM keys to calculate (1 + (yield% + tax_rate%))^(-n)

by setting the following values:


n,  yield + tax_rate → I/YR%, 0 → PMT, -1 → FV, solve for PV.



3.  Calculate the total property value.


Property Value = PV_reversion + PV_income




HP 12C Platinum Program:  Property Value by Reversion Method


Store before running the program:


n =  number of years of remaining economical life of the property

i = yield interest rate

R7 = property tax rate

R8 = net income before taxes (NBIT)

R9 = expected revision value of the property (the value of the property at the end of it's economic life)


Code:

step;  key code;  key


001;  0;  0

002;  44,0;  STO 0

003;  1;  1

004;  16;  CHS

005;  13;  PV

006;  0;  0

007;  14;  PMT

008;  15;  FV

009;  1;  1

010;  30; - 

011;  22; 1/x

012;  45,12;  RCL i

013;  25;  %

014;  45,12;  RCL i

015;  1;  1

016;  25;  %

017;  34;  x<>y

018;  33;  R↓

019;  40;  +

020;  45, 7;  RCL 7

021;  1;  1

022;  25;  %

023;  34;  x<>y

024;  33;  R↓

025;  40;  +

026;  45, 8;  RCL 8

027;  34;  x<>y

028;  10;  ÷

029;  44,40,0;  STO+ 0

030;  45, 12; RCL i

031;  45, 7;  RCL 7

032;  40;  +

033;  12;  i

034;  1;  1

035;  16;  CHS

036;  15;  FV

037;  0;  0

038;  14;  PMT

039;  13;  PV

040;  45, 9;  RCL 9

041;  20;  ×

042;  44,40,0;  STO+ 0

043;  45,12;  RCL i

044;  45,7;  RCL 7

045;  30;  -

046;  12;  RCL i

047;  45,0;  RCL 0

048;  43,33,000;  GTO 000



Examples



Example 1


NBIT:  $7,588  (store in R8)

Reversion Value:  $236,000 (store in R9)

Tax Rate:  1.3%  (store 1.3 in R7)

Annual Rate:  8%  (store in i)

Years of Economical Life Remaining:  5  (store in n)


Property Value:  $180,092.06



Example 2


NBIT:  $12,000

Reversion Value:  $185,000

Tax Rate:  1.6%  

Annual Rate:  7.34%

Years of Economic Life Remaining:  10


Property Value:  $153,286.39




Sources


"Lesson 4 - Time Value of Money (The Income Approach to Value)"  California State Board of Equalization.  Accessed March 27, 2023. https://www.boe.ca.gov/info/iav/lesson4.htm


"Lesson 18 - Property Reversion:  Annuity plus Reversion Method (The Income Approach to Value" California State Board of Equalization.  Accessed March 27, 2023.  https://www.boe.ca.gov/info/iav/lesson18.htm



Eddie



All original content copyright, © 2011-2023.  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. 


Sunday, March 24, 2019

HP 17BII and HP 17BII+: Finance Solver Equations

HP 17BII and HP 17BII+:  Sales Tax, Substantial Presence Test, Automobile Purchase, Principal Interest Property Tax & Insurance (PITI), Retirement Accounts

Note:  Some equations have the L (Let) and G (Get) functions, which are not available on the brown keyboard of the 17BII+ (around 2003). 

Sales Tax:  Determine the total amount of taxable items and non-taxable items.

AMT=NTAX+TXBL*(1+R%÷100)

AMT:  Total Amount
NTAX:  Items not subject to sales tax
TXBL:  Items subject to sales tax
R%:  sales tax rate

Example 1:  A company purchases equipment which costs $99.99, which was subject to 9.5% sales tax, which includes $139.99 of services.  The services are not subject to sales tax.  What is the total invoice? 

Input:
NTAX:  139.99
TXBL: 99.99
R%:  9.5(%)

Output:
AMT = 249.48

The total of the invoice is $249.48.

Example 2:  During an audit, a company finds an invoice with the total of $236.40 (amount), and the invoice listed non-taxable services of $146.50.  The company lives in a county where the sales tax is 8.75%.  What is the amount of taxable items? 

Input:
NTAX:  146.50
R%:  8.75(%)
AMT:  236.40

Output:
TXBL = 82.67

The amount of taxable items on the invoice is $82.67.

Substantial Presence Test

For more information about the substantial presence test, please click here:  http://edspi31415.blogspot.com/search?q=substantial+presence+

This equation uses Let and Get. 

SPT=IF(L(X:DDAYS(D:12.31+FP(100*D)÷100:1)>183:DATE(D:183):DATE(1.01+(FP(100*D)+.0001)÷100:IP(183-G(X)÷3)))

STP:  Number of days calculated for the Substantial Presence Test
D:  Date (in the format DD.MMYYYY)

Example 1:

D:  1.052019 (1/5/2019),  SPT = 7.072019 (7/7/2019)

Example 2:

D:  6.182008 (6/18/2008), SPT = 12.182008 (12/18/2008)

Example 3:

D:  9.262018 (9/26/2018), SPT = 6.012019 (6/1/2019)

Example 4:

D:  7.102017 (7/10/2017), SPT = 5.062018 (5/6/2018)

Financing the Purchase of an Automobile

This equation deals with the purchase of an automobile. 

AUTO:PRICE*(1-DISC%*.01)*(1+STAX%*.01)-DOWN=PMT*USPV(I%÷12:YRS*12)

PRICE: Sticker price of the automobile
DISC%:  Discount percent
STAX%: Sales tax rate
DOWN:  Down payment (amount)
PMT:  Payment of the loan
I%:  Interest rate of the loan
YRS: Number of years of the loan

Example 1:  The sticker price of a car is $28,000.00.  A discount of 15% is offered.  The car is subject to 10% sales tax.  The dealer offers a 6-year loan at 4.5%.  With $2,000, what is the monthly payment?

Input: 
PRICE: 28000.00
DISC%: 15
STAX%:  10
DOWN: 2000
I%:  4.5
YRS: 6

Output:
PMT = 383.83

The monthly payment is $383.83. 

Example 2:  Assuming the same facts from Example 1, expect the buyer wants to pay no more than $350.00 a month.  What is the required down payment?

Input: 
PRICE: 28000.00
DISC%: 15
STAX%:  10
I%:  4.5
YRS: 6
PMT: 350.00

Output:
DOWN = 4131.42

The down payment needs to be $4,131.42.

Real Estate:  Principal Interest Property Tax & Insurance (PITI)

Determine the total payment of mortgage when considering property tax and property insurance. 

PITI=MORT÷USPV(I%÷12:YRS*12)+(PROP$+INS$)÷12

PITI:  Payment including principal, interest, property tax, and insurance
MORT:  Mortgage amount, price of the property
I%:  Annual interest rate
YRS: Number of the years of the mortgage
PROP$:  Annual property tax
INS$:  Annual property insurance

Example:  A buyer purchases a home with a price of $200,000.00.  The amount is to be financed.  The loan lasts for 30 years and 5% interest rate.  There is annual property tax of $1,200.00 with insurance of $395.95.  What is the buyer's PITI?

Input:
MORT: 200000.00
I%:  5
YRS: 30
PROP$:  1200.00
INS$:  395.95

Output:
PITI = 1206.64

The buyer's PITI is $1,206.64. 

Retirement Accounts:  Future Value and Earned Untaxed Dividends

Determine the future value and untaxed dividends of tax-free retirement accounts (IRS/Keogh).

There are two versions, the second uses Let (L) and Get (G) functions.

Version 1:
IRA: VAL*0+DIV*0+IF(S(VAL):USFV(I%:YRS)*PMT*(1+I%÷100)-VAL:0)+IF(S(DIV):(USFV(I%:YRS)*(1+I%÷100)-YRS)*PMT-DIV:0)

Version 2:
IRA:(VAL+DIV+L(X:USFV(i%:YRS)*(1+I%÷100)))*0+IF(S(VAL):G(X)*PMT-VAL:(G(X)-YRS)*PMT-DIV)

Input Variables:
I%:  Annual Interest Rate
YRS:  Number of Years
PMT:  Annual Payment

Output Variables:
VAL:  Tax Free Value of the Retirement Account
DIV:  Total Untaxed Dividends Earned

Remember, these are untaxed amounts.

Example:
I%:  6.88
PMT:  1000.00
YRS: 40

Output (Results):
VAL = 206811.01
DIV = 166881.01

Source:
Tony Hutchins, Luiz Vieria, and Gene Wright "HP 12C Platinum Solutions Handbook"  Hewlett Packard.  Revised 03.04  2004

Eddie

All original content copyright, © 2011-2019.  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.

Thursday, July 14, 2016

HP 12C Programming Part II: Weekday Number, Gross Up Calculation

HP 12C Programming Part II:  Weekday Number, Gross Up Calculation

Here is Part II of the HP 12C programming series.

HP 12C Weekday Number

This program determines (“extracts” in a sense) the workday number of a given date.  I have this program set to work properly after January 6, 1800, which was a Monday.  The results translate as follows:

1 = MON
2 = TUE
3 = WED
4 = THU
5 = FRI
6 = SAT
7 = SUN

The HP 12C is assumed to be use the United States date format (M.DY – [ g ] [ 5 ]).

Program:
STEP
CODE
KEY
COMMENT
01
1
1

02
48
.
Decimal point
03
0
0

04
6
6

05
1
1

06
8
8

07
34
X<>Y

08
43, 26
ΔDYS
Days between dates function
09
7
7

10
10
÷

11
43, 24
FRAC

12
7
7

13
20
*

14
1
1

15
40
+

16
43, 33, 00
GTO 00


Input:  Date in MM.DDYYYY format, [R/S]
Result: Date indicator

Test 1: May 22, 1999.
Input:  5.221999 [R/S]
Result:  6 (Saturday)

Test 2:  July 11, 2016

Result:  1 (Monday)

HP 12C Gross Up Calculation

We have to pay a person, and the person lives outside of your tax jurisdiction (outside of your state or the United States).  Tax withholding may be required.  However, you or someone else that is requesting the payment wants the face amount.  In order to give the face amount and fulfill the tax requirement at the same time, the payment is must be grossed up.

Link to the Investopedia article:  http://www.investopedia.com/terms/g/gross-up.asp

Formulas:
Gross up Amount = Face Amount/(1 – Tax Rate%)
Amount of Tax = Gross up Amount – Face Amount

Program:
STEP
CODE
KEY
COMMENT
01
44, 0
STO 0
Store Tax Rate
02
34
X<>Y

03
44, 1
STO 1
Store Face Value
04
45, 0
RCL 0

05
1
1

06
25
%

07
1
1

08
30
-

09
16
CHS

10
45, 1
RCL 1

11
34
X<>Y

12
10
÷

13
31
R/S
Display Gross up Amount
14
45, 1
RCL 1

15
30
-

16
43, 33, 00
GTO 00
Display Tax

Input:  face value, [R/S], tax rate, [R/S]
Result: gross amount, [R/S], tax

Part 1:  Face Value:  $1,000, Tax Rate:  30%.
Input:  1000 [R/S], 30 [R/S]
Result:  1428.57 [R/S], 428.57 [R/S]
The gross up amount is $1,428.57 (total amount to be paid), and corresponding tax is $428.57.

Part 2:  Face Value:  $2,500, Tax Rate:  7%.
Input:  2500 [R/S], 7 [R/S]
Result:  2688.17 [R/S], 188.17 [R/S]
The gross up amount is $2,688.17 (total amount to be paid), and corresponding tax is $188.17.


Another note, I will be taking some time off and plan to be back within two weeks.  I want to thank all of you readers and those who commentators, this blog would not be the success that it is without you.  Enjoy summer (or winter if you are in the Southern Hemisphere) and we'll talk again.  

Eddie

This blog is property of Edward Shore, 2016. 

RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...