SIE 265 · SIE 377 · FIN 304 · 2020–2022 · University of Arizona · Solo work

Excel and VBA Projects

Spreadsheet models and VBA from my engineering and finance courses. I designed the retirement planner myself, and it runs in this page.

  • Excel
  • VBA
  • Financial modeling
  • ADO / Access
  • Python
  • JavaScript

Where these come from

Two of my systems engineering courses were built around Excel: SIE 265, engineering management (Fall 2020), and SIE 377, VBA and Python for decision support (Fall 2021). So was FIN 304, a real estate course in my finance minor (Summer 2020). The retirement planner was my own design, for an honors project; the rest follow the instructors' briefs.

Retirement planner (SIE 265 honors, Fall 2020)

The planner finds the share of salary you must save so the money runs out exactly at the age you choose. You set the ages, salary, income needed, inflation, stock and bond mix, returns, tax rate and employer match. A macro rebuilds the yearly tables, the net present value (NPV) rows and four charts to fit the ages, and two buttons run Goal Seek, Excel's one-variable solver, on either the contribution rate or the retirement income until the balance at the target age is zero.

The numbers

Salary at 25$75,000
Income needed80%of final salary
Retired from67 to 97
Share of salary to save12.01%

With the inputs saved in the final file ($75,000 at 25, retiring at 67, 80% of final salary until 97), the answer is 12.01% of salary.

The planner's Interface sheet in Excel: a dark dashboard with salary, contribution, income needed and ages across the top, the before- and after-tax NPVs, the two Optimize buttons and a Generate Data button, the rate inputs down the left, and four line charts of contributions, the growing balance, withdrawals and the balance falling to zero at 97
The final Interface sheet: the solved balance reaches zero at exactly 97.

The planner in the browser (2026)

I ported the workbook's formulas to JavaScript, with a bisection search in place of Goal Seek. Against the values saved in the final file, the balances, both NPVs and the solved contribution agree to the cent.

Solve for

Point at the chart to read a year.

Bars below the balance: each year's money in (top) and withdrawn before tax (bottom), each half on its own scale.

balance at retirement
first year's income, take-home
withdrawn to pay it, before tax
you put in
your employer put in
present value, take-home
present value, before tax

Porting turned up four workbook quirks, which the demo keeps so its numbers match. The workbook's "After Tax" withdrawal and NPV are really before tax, so the demo relabels them. Contributions run to the retirement age inclusive, 43 rows for a 42-year career. Below the employer's limit, the match equals your contribution whatever the match rate. And every year earns the same blended return, so there is no market risk.

Wildcat company model (SIE 265, Fall 2020)

The SIE 265 course project was a financial model of a fictional manufacturer, built over nine assignments: monthly forecasts feeding an income statement, cash flow statement, balance sheet, loan schedule and equipment depreciation. The last assignment compared building the product in-house with outsourcing it, at a 27% discount rate. My model gave in-house an NPV of $69,765 against $37,266 and a benefit-cost ratio of 2.26 against 1.94, and recommended building in-house.

The Valuation sheet: twelve months of before-equity and discounted cash flows for the in-house scenario, then NPV 69,765, annual equivalent $19,971.05, B/C ratio 2.26, IRR 14.24%, MIRR 9.58%, company funds 78,000, and the same block for the outsourced scenario with NPV 37,266
The final Valuation sheet: in-house above, outsourced below.

Rental property analysis (FIN 304, Summer 2020)

FIN 304 followed one rental property, a triplex near Northern Arizona University in Flagstaff, from purchase to sale over three projects. I took it the summer after my freshman year, in the first months of COVID, while the market it studied was changing week to week: falling mortgage rates, loans in forbearance, and cash buyers outbidding financed offers.

At a glance

Property
A triplex near Northern Arizona University, Flagstaff
Purchase
$270,000, 20% down, 15-year loan at 4.75%
Payment
$1,680.12 a month, $86,421 interest over the loan
After the mortgage
$369 a month short, with $825 of each payment to principal
Valuation
$317,051; I would have listed it at $316,000

I interviewed a Tucson realtor about the market, compared the property with its neighborhood, listed the inspections it needed and chose between two rental applicants. At $270,000 with 20% down on a 15-year loan at 4.75%, the payment is $1,680.12 a month and the interest over the loan is $86,421; I also completed the buyer's and seller's closing statements. The last project ran it month to month, depreciation and its tax savings included, then priced the sale from comparable sales and from a cap rate.

After the mortgage the property ran $369 a month short, though $825 of each payment went to principal. I valued it at $317,051, the average of the two methods, and would have listed it at $316,000.

The Cash Flow Worksheet: rent income of 2,275 a month; insurance, management fees, property taxes, other expenses and utilities; depreciation of 606.06 in the tax column; the first mortgage payment split into 825.12 principal and 855.00 interest; a net cash flow of minus 369.34 after 58.44 of tax savings; and net income before financing of 1,310.78
Rent covers the expenses, but not the mortgage.
The Sale of Property sheet: three comparable sales with an average gross rent multiplier of 143.16, giving an estimated value of 325,684.89; a cap rate at purchase of 5.83% and a comparable cap rate of 5.10%, giving 308,418.11; and an average valuation of 317,051.50
Two routes to a sale price, averaged.

International tourism decision guide (SIE 377, Fall 2021)

My solo SIE 377 project was a decision-support tool for international tourism companies, built on UN World Tourism Organization (UNWTO) arrivals data and an Access database of UN countries, regions and GDP. A pandas script cleans the UNWTO spreadsheet into a workbook of arrivals by region and year, with each region's mean, minimum and maximum. In Excel, a VBA main menu opens a Chart Builder for that workbook and a Query Builder that reads the Access database through ADO: pick a country for its GDP by year, then a year for its region.

The Query Builder form: Libya selected in the country list, its GDP by year from 2003 to 2019 in the results list, and 2007 selected, which fills in Libya, 2007, its GDP, Africa and Northern Africa on the right
The Query Builder, reading live from the Access database.
The Chart Display form showing a column chart of mean, minimum and maximum tourist arrivals for the Americas, Asia Pacific, the Middle East, Africa and Europe; Europe is far the highest
Europe draws far more arrivals than any other region.

Coursework and tutoring

The SIE 377 homework built the pieces the project used: reporting macros, chart generation and user forms. I tutored SIE 377 in Fall 2022.

The Decision Guide Main Menu form: Chart Builder, Query Builder and About Our Datasources buttons, two path boxes for the tourism data file and the database with browse buttons, and Cancel
The tourism guide's main menu.
A homework form titled Course and Summary Selections: option buttons for courses DS310, DS320 and DA510, and check boxes for count, median, average, standard deviation, minimum and maximum
A homework form for picking a course and its summary statistics.

What I took from it

Rewriting a spreadsheet as code is a thorough audit: porting the planner made me restate every formula, and that is how the four quirks surfaced. The one that matters is the fixed return. The plan either works or it does not, and 12.01% says nothing about how likely it is to hold.

The sequel I would build is a Monte Carlo version in VBA: thousands of random market paths with correlated stock and bond returns, giving the chance the money lasts and the savings rate that reaches a chosen probability. With volatility at zero it must land on 12.01% again, a built-in check against the 2020 plan.

Want the details behind this one, or to talk about similar work?