If you want to do a few budgeting calculations, it’s probably overkill to load up a spreadsheet app. It can also be difficult to keep track of what all the numbers are and how they relate.
That’s where Calca comes in. Calca is a cross between a Markdown text editor and a spreadsheet. It allows you to write a regular Markdown document, but you can also add inline calculations which Calca will calculate and update the results live as you type. And, it's cross platform, so you can use it on Mac, Windows, and iOS devices.
In this tutorial, I’ll show you the basics of how to use Calca, and then show you how to use the app to help with budgeting and finance calculations.
Learn the Basics
If you’ve used Calca before and just want to get into the budgeting and finance parts, feel free to skip this section.
In a new Calca document, type in a few calculations on separate lines. Calca
supports pretty much any operation you might need for finance calculations,
including exponents, using
^, and percentages.
After each calculation, type
=> to get the result. Calca calls this the
therefore operator, and it simplifies the closest expression to the left. In
most cases, this means giving the result of a calculation.
Once the result of a calculation has been inserted, Calca updates it live as you change values in the calculation. Try it out by changing some of the numbers in your calculations and watch the answers update in real time. Anything with a light grey background is a calculated result, and cannot be edited directly.
Type a word or phrase followed by an equals sign,
=, and then an expression to
define a variable. In Calca, variable names are allowed to contain spaces, so
using more than one word is perfectly fine. The expression on the right will be
evaluated to find a value for the variable.
Once defined, a variable can be used anywhere in another calculation, even in the definition of another variable.
Calca can make it super easy to create something like a monthly budget, simply by listing your income and your expenses and doing a little addition and subtraction.
List your income
In your budget document, create a variable called
income. Instead of just using
+=. This allows you to then write a list of “sub-variables” which will automatically be summed to find a value for
On separate lines, create new variables, one for each type of income. In my example I’m creating a monthly budget, but this will work the same for weekly or even yearly budgets, if you prefer those.
List your outgoings
Below the definition for
income, do the same thing for a new variable called
outgoings. Then list your expenses, one on each line, in the same way as for
Work out what’s left
Now create a final variable called
left to spend, or something similar to that. This will hold the amount you have left after your regular outgoings. The value for this variable is simply
income - outgoings.
More complicated timespans
Maybe your budget is more complicated, and part of your regular income is monthly, and some is weekly. That’s perfectly easy to do in Calca; just specify the timespans after the amounts, such as
£200/week. Then, when you perform the final calculation, simply add
in £/month to convert to a per-month value.
Note that you need to add the timespan after every value, otherwise the units won’t match up at the end, and you won’t get a single value as the answer.
This technique is also useful for seeing how much money you have per week, or per day; since the result is calculated in real time, you can just replace
£/week and the value will update automatically.
Use if statements to make decisions
If you want to use your budget to work out if you can afford something, or find out the answer to a similar question, you can use Calca’s built in if statements to do so.
Create an if statement using the syntax
if condition then resultA else resultB. For example, say you’re trying to work out which capacity iPad you can afford to buy this month. Create a variable for each capacity iPad with its price.
Next, set up the if statement. If there are more than two options, you can use
else if to test another condition. For the iPad example, you could use something like:
affordable ipad= if left to spend > ipad 32gb then "32GB" else if left to spend > ipad 16gb then "16GB" else "None"
Then, just evaluate the
affordable ipad variable to find out which capacity iPad you can afford.
It looks like you’re going to have to put in a bit more overtime if you want that shiny new device to play with! You could always do a few more calculations to work out how many extra hours you’ll have to work.
Calca also works great for other finance-related calculations, such as working out the repayments on a loan, for example. I’ll use the example of monthly payments on a car so you can get a feel for these calculations in Calca, and then you can apply the techniques to your own calculations.
Enter the cost information
Start out by creating a variable for the original cost of the car. Then, if the loan requires a deposit, add a variable for that, too. If the deposit is a percentage of the cost, it’s easy to calculate; just type
deposit = price of car * 12.5%.
You don’t have to type
=> after every calculation, only the ones you want to see the result of. Any intermediate calculations that you don’t care about the result of can just be left.
Enter the loan information
Now create three more variables,
loan length and
The loan amount is simply
price of car - deposit – it’s the amount the loan is actually for, which doesn’t include the deposit.
Loan length is the length of the loan in months. You don’t necessarily have to give it the unit
months, but since the idea of Calca is to make the calculations more readable, it’s a good idea.
Finally, interest is the interest rate as a percentage. It can simply be typed as a number followed by a percent sign, there’s nothing fancy to do here.
Find out the cost per month
This is the important bit! The calculation for the cost per month is:
cost per month = (loan amount * ((1 + interest)^(loan length / 12 months))) / loan length
Simply add that line, and the result will be the monthly payment on the loan.
If you think the
/months unit is messy, you can always add another line,
cost per month in £/month to change the units.
Find out the total cost of the loan
The last thing to do is work out how much the car will cost after the interest is added and the loan is paid off. All you need to do here is multiply the monthly cost by the length of the loan, and add the deposit back on.
Now you can experiment by changing the price of the car and the length of the loan to work out the best options for you.
In this tutorial I’ve shown you how to use Calca to help out with budgeting and finance calculations. There are many other possible uses for the app, and the skills you’ve learned here can be translated to all sorts of other uses. Check out Calca’s Examples page to get an idea of the kinds of things it can do. There’s also a reference page which is a list of all of Cacla’s functionality.
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post