# How to Coda Net Present Value?

## What is 100K worth today when you receive it in 10 years?

--

The answer depends on the percentage you apply to cover interest rates and opportunity costs.

Most Coda makers understand how to apply the `Power()` function to deal with interest rates and understand how much they need to be pay when you take a mortgage. I wrote a blog about it and I published a doc .

Kids learn this calculations already in secondary school and have to use a spreadsheet to make it work, often Excel by the way. In Coda the calculation of loan is rather straightforward as is the Net Present Value formula.

Formulas required to calculate the Interest to pay and NPV formulas are similar and each other’s reflection.

`Product(Power(1 + thisRow.percentage,thisRow.years),thisRow.amount)Quotient(thisRow.amount,Sum(1,thisRow.percentage).Power(thisRow.years))`

This is a simplification of how the NPV often is used.

The idea is that you guestimate the percentage per period you have to apply. In an NVP the percentage is the (opportunity) costs you assume. In the first example each year has the same percentage and that makes it easy. When you close a mortgage in most cases you get a rate for a certain period. Each contract tells how much to pay, for how long and when a next contract has to be closed, you hope that the interest rates are low and you pay your interest on the not yet paid part of the loan.

In an NPV logic, you can for example assume the inflation as a base rate and you can add per year or per certain period an additional layer that reflects the assumed opportunity costs.

The main trick is see that to to get the NPV you have to start at the end. Remember that when you have to calculate compound interest for 10 years split over 3 periods with variable interest rates you start with period 1 and you use the outcome as input for period 2. You finish by taking the outcome of period 2 and apply the interest rates of period 3. This is in case of interest, thus the price for the money you have to pay.

To get the NPV you walk back in time.

You start with the interest rates and the duration of the latest period. The outcome of this third period is used in the second period as input. Finally the output of period two becomes the input for period one. It is the other way around.

I gave you the basics, now it is up to you to make the calculation work. It is not complicated, start where you have to and keep your steps small.

I came to write about the issue since one of my relations asked for a solution for which you can find outside Coda many great tools. However it is easier to have the data available inside Coda.

My name is Christiaan and blog about Coda Since the summer of 2023 mainly about how to Coda with AI to support organisations dealing with texts and templates. Why I focus on Coda AI you can read here: ⤵️

My blogs are for beginners and experienced users. The central theme is that in Coda everything is a list.