Variables & Line References

Because words make more sense than un-named numbers.

Declaring a variable

Soulver lets you create variables.

Declare a variable with the equals symbol '='.

discount = 10%                         | 10%
cost = $550                            | $550
cost - discount                        | $495.00  

A variable can be a single word, or an entire phrase (with spaces).

You can't use a variable before it has been declared.

This behaviour matches most programming languages, but differs from Soulver 2.

Changing variables' values

A variable can be redefined by giving it a new value.

The most recently defined value will be used on subsequent lines.

monthly rent = $1,900 // 2018      | $1,900
monthly rent = $2,150 // 2019      | $2,150
monthly rent / 4 people            | $537.50

You can 'peek' at a variable's current value by holding down the shift key, and hovering over the variable.


Instead of typing out a long variable name, you can hit the escape key and return to auto-complete the variable.

Global variables

To add a variable that works across all your sheets, go to Settings > Calculator > Global Variables and add a new variable by clicking the plus button.

Line References

Soulver lets you reference previous lines' answers in your calculations, like a spreadsheet. You can go back and edit a previous line, and any lines that refer to will recalculate automatically.

To reference a previous line:

1. Drag in the answer from the line you want to reference:

You can also just double click the answer to insert a reference to it

2. Type an operator (like +) immediately after typing return to start a new line:

You can also insert a reference to the previous line using the keystroke ⌘\.

Note: you can only reference a line above your current line.

If you want to disable a reference, but keep an expression in its current state, you can right-click on a reference and choose 'Unlink'.

Last updated