Formulas¶
A formula works something out from numbers and other cells: a bill's total, the GST on it, a salary's PF deduction. It starts with an equals sign, and Ganit works it out again whenever a cell it uses changes.
The tools for formulas are on the Formulas tab: the Function Library, Defined Names, Formula Auditing and Calculation groups. Every function, with an example of each, is in the Function reference.
Writing a formula¶
- Click the cell where the result should go.
- Type
=and then the formula, for example=B2*C2for quantity times rate. - Press Enter.
The cell shows the result. The formula bar above the grid shows the formula while the cell is selected.
You can type the formula in the cell or in the formula bar. The buttons beside the formula bar are ✕ (cancel, the same as Esc), ✓ (enter) and fx (Insert Function).
- Press Enter to finish and move down, Tab to move right, or Ctrl+Enter to stay in the cell. With several cells selected, Ctrl+Enter puts the formula in all of them.
- Press Esc to cancel.
- To change a formula, select the cell and press F2, or click in the formula bar.
If a formula ends without its closing brackets, Ganit adds them: =SUM(A1:A3 becomes =SUM(A1:A3). If a formula can't be read, Ganit shows "There's a problem with this formula." with the reason, and leaves you in the cell to fix it.
Tip
To type text that starts with =, such as =1+1 as a label, put an apostrophe first: '=1+1.
Pointing at cells¶
You don't have to type cell addresses. While writing a formula, after =, an operator such as + or a comma:
- Click a cell to put its address in the formula, or drag over a range.
- Or use the arrow keys to move to the cell. Hold Shift with the arrows to make it a range.
- Click a sheet tab to point at a cell on another sheet.
Each reference in the formula gets its own colour, with a box of the same colour round its cells.
The status bar shows the mode: Enter while you type, Point while you pick a cell, and Edit when the arrow keys move inside the formula. Press F2 to switch between Enter and Edit.
Function names and their arguments¶
As you type a function's first letters, Ganit lists the functions, names and tables that start with them, with what each does. Use the up and down arrows to pick one, and Tab or Enter to put it in.
After the opening bracket, a tip under the cell shows the function's arguments, with the one you're typing in bold. Arguments in [square brackets] can be left out.
Operators¶
| Operator | Meaning | Example | Result |
|---|---|---|---|
+ |
Add | =2*3+4 |
10 |
- |
Subtract, or a minus sign | =10-4 |
6 |
* |
Multiply | =12*15 |
180 |
/ |
Divide | =180/12 |
15 |
^ |
Power | =5^2 |
25 |
% |
Per cent | =50%*200 |
100 |
& |
Join text | ="Pune"&" "&"411001" |
Pune 411001 |
= <> |
Equal, not equal | =5<>4 |
TRUE |
> < >= <= |
Compare | =10>=10 |
TRUE |
: |
A range of cells | =SUM(B2:B9) |
the sum of B2 to B9 |
, |
Separates a function's arguments | =ROUND(2.345, 2) |
2.35 |
Ganit works out ^ first, then * and /, then + and -, then &, and the comparisons last. Use brackets to change the order: =2*(3+4) is 14.
A minus sign in front of a number comes before ^, so =-2^2 is 4. Write =-(2^2) for -4.
Text in a formula goes in double quotes. Comparing texts doesn't look at capital and small letters: ="tea"="TEA" is TRUE.
Relative, absolute and mixed references¶
A reference like B2 is relative. When you copy the formula or fill it down, the reference moves with it: =B2*C2 in D2 becomes =B3*C3 in D3. That's what you want for a column of totals.
A $ sign fixes the column, the row or both:
| Reference | When copied | Use it for |
|---|---|---|
B2 |
Column and row both move. | Most formulas. |
$B$2 |
Stays B2. | One cell every row uses, such as the GST rate or the days in the month. |
B$2 |
The column moves, the row stays 2. | A rate in a heading row. |
$B2 |
The column stays B, the row moves. | A value in a fixed column, such as in a conditional formatting rule. |
For example, copying =B1*C1+$F$1+B$1+$C1 one row down and one column right gives =C2*D2+$F$1+C$1+$C2.
To add the $ signs, click in a reference while typing and press F4. Each press goes to the next kind: B2, $B$2, B$2, $B2, then back to B2.
On Ganit's Salary Sheet template, Gross Earned in H5 is =IF(B5="","",ROUND((E5+F5+G5)*D5/$F$2,0)). The days in the month are in F2, so every employee's row uses $F$2, while E5, F5, G5 and D5 move down to each employee's own row.
Using other sheets¶
To use a cell on another sheet, put the sheet's name and ! before the address:
=April!B25is B25 on the sheet called April.- If the name has spaces or other signs, put it in single quotes:
='Stock Nashik'!B2.
The easy way is to point: type =, click the other sheet's tab, click the cell, and press Enter. Ganit takes you back to the sheet you started on.
If the sheet doesn't exist, or is deleted, the formula shows #REF!.
Note
A range across several sheets, such as =SUM(April:March!B25), isn't supported. Add the cells one by one: =April!B25+May!B25+June!B25.
Formulas that spill¶
Some functions give more than one value, such as a list or a table. The result spills into the cells below and to the right of the formula.
For example, =SEQUENCE(4) in E2 fills E2:E5 with 1, 2, 3 and 4. =UNIQUE(A2:A500) lists each customer once, as many rows as there are customers.
Functions that spill include SEQUENCE, FILTER, SORT, SORTBY, UNIQUE, TRANSPOSE, TEXTSPLIT, TAKE, DROP, VSTACK, HSTACK, MAKEARRAY and RANDARRAY. A range on its own, such as =A1:A3, spills too.
- Only the first cell holds the formula. To change or delete the result, change or delete that cell.
- To use the whole spilled result in another formula, put # after the first cell: if
=SEQUENCE(3)is in F13,=SUM(F13#)is 6. - The result needs empty cells. If something is in the way, the formula shows #SPILL!. Click the cell, click the warning button beside it, and choose Select Obstructing Cells to find what's in the way.
Quick sums with AutoSum¶
- Click the cell under a column of numbers (or to the right of a row).
- Click Home ▸ Editing ▸ Sum, or press Alt+=.
Ganit writes =SUM(…) over the numbers above or to the left. Check the range, and press Enter.
Click the arrow beside Sum for Average, Count Numbers, Max and Min, or More Functions… for the Insert Function dialog. The same menu is at Formulas ▸ Function Library ▸ Sum.
The Function Library¶
The Formulas tab has a button for each group of functions. Click one to see its functions, and click a function to start it in the active cell: Ganit types = and the function's name with an opening bracket.
| Button | Functions |
|---|---|
| Insert Function | Opens the Insert Function dialog. |
| Sum | Sum, Average, Count Numbers, Max, Min. |
| Recently Used | The last 10 functions you used. When Ganit starts, the list has SUM, AVERAGE, IF, VLOOKUP, COUNTIF, ROUND and TODAY. |
| Financial | Loans, EMIs, interest, depreciation, returns. |
| Logical | IF, AND, OR, IFERROR, LET, LAMBDA and more. |
| Text | Joining, splitting, cutting and changing text. |
| Date & Time | Dates, days between dates, working days. |
| Lookup & Reference | VLOOKUP, XLOOKUP, INDEX, MATCH, FILTER, SORT, UNIQUE and more. |
| Math & Trig | Sums, rounding, SEQUENCE and more. |
| India | Ganit's own functions: amounts in words, lakhs and crores, GST and PAN checks, the financial year, Kruti Dev. |
| More | Statistical and Information functions. |
The India menu also has Insert Holiday List…. It adds a sheet called Holidays with the Central Government's gazetted holidays for a year you choose, for use with NETWORKDAYS.INTL and WORKDAY.INTL. See Indian formats, words and languages.
The Insert Function dialog¶
Open it with Formulas ▸ Insert Function, the fx button beside the formula bar, or Shift+F3.
- In Search for a function, type what you want to do, such as "EMI", "lookup" or "words". Or pick a group in Or select a category.
- Click a function in Select a function. Under the list, Ganit shows how it's written and what it does.
- Click OK, or double-click the function.
The categories are Most Recently Used, All, Financial, Date & Time, Math & Trig, Statistical, Lookup & Reference, Text, Logical, Information and India.
If you open the dialog while typing a formula, the function goes in where the cursor is.
Click Examples ▸ under the description to open the function in the Functions guide.
The Functions guide¶
Help ▸ Functions opens a guide to every function. Search by name or by what you want to do, or pick a category. For each function it shows how it's written, its arguments, and examples with their results, worked out by Ganit. Some examples use a small table of tea, coffee and samosa sales that the guide shows above them.
- Copy copies an example's formula.
- Use in Cell starts the function in the active cell.
Names for cells and values¶
A name stands for a cell, a range or a value. =SUM(Sales)*GST is easier to read than =SUM(Sheet1!$C$2:$C$200)*$H$1.
Naming cells with the Name Box¶
- Select the cells, for example the GST rate in H1.
- Click in the Name Box, left of the formula bar.
- Type the name, such as GST, and press Enter.
To go to a named range, pick it from the Name Box's list, or type its name there and press Enter.
Define Name¶
Click Formulas ▸ Defined Names ▸ Define Name. The New Name dialog has:
| Field | What it holds |
|---|---|
| Name | The name. Ganit suggests the label above or to the left of the selection. |
| Scope | Workbook (the name works on every sheet) or one sheet. |
| Comment | A note about the name, shown in Name Manager. |
| Refers to | The cells, such as =Sheet1!$B$2:$B$20, or a value, such as =18%. |
A name must start with a letter or _, and can have letters, numbers, full stops and _. It can't have spaces, and it can't look like a cell address, such as A1.
A name can also hold a LAMBDA, which makes a function of your own. For example, a name WithGST that refers to =LAMBDA(x, x*(1+GST)) lets you write =WithGST(1000). With GST at 18%, that gives 1180.
Create from Selection¶
To name each column of a table by its heading:
- Select the table with its heading row, for example A1:D20.
- Click Formulas ▸ Defined Names ▸ Create from Selection.
- Tick Top row (the headings), Left column (the labels in the first column), or both.
- Click OK.
Each column gets a name from its heading, for the cells below it. Spaces and signs in the headings become _: "Other Charges" becomes Other_Charges. The status bar lists the names made.
Using names in formulas¶
Type the name in a formula, like any cell address: =SUM(Qty)*GST. Ganit lists names as you type, along with functions.
Or press F3 (Formulas ▸ Defined Names ▸ Use in Formula) and pick a name from the list. The list also has the workbook's tables.
Name Manager¶
Formulas ▸ Name Manager (Ctrl+F3) lists every name with what it Refers To, its Scope and its Comment. Tables are listed too.
- New… makes a name.
- Edit… (or double-click) changes a name, what it refers to, or its comment. The scope can't be changed.
- Delete removes a name. Formulas that use it then show #NAME?.
Tables can't be edited or deleted here. Change them on the Table Design tab.
Checking formulas¶
The Formula Auditing group on the Formulas tab helps find where a number comes from, and why a formula gives an error.

Trace Precedents and Trace Dependents¶
- Click a cell with a formula, such as an employee's Gross Earned.
- Click Formulas ▸ Formula Auditing ▸ Trace Precedents.
Blue arrows run into the cell from every cell its formula uses. A range gets a box round it. Click Trace Precedents again to go back one more level, to the cells those cells use.
Trace Dependents works the other way: arrows run from the active cell to the formulas that use it. Click it again for the next level.
A cell on another sheet is shown by a dashed arrow from a small sheet symbol.
To take the arrows away, click Remove Arrows. Its arrow has Remove Precedent Arrows and Remove Dependent Arrows to remove one kind.
Show Formulas¶
Formulas ▸ Show Formulas (Ctrl+`) shows the formulas in the cells in place of their results. Click it again to go back.
Error checking¶
Ganit marks some cells with a small green triangle in the corner:
| Mark | Why |
|---|---|
| Error in Value | The formula's result is an error, such as #DIV/0!. |
| Number Stored as Text | A number formatted as text, or typed with an apostrophe. It isn't counted in sums. |
| Inconsistent Formula | The formula differs from the formulas on either side, which match each other. |
| Spill Range Isn't Blank | A formula can't spill because cells are in the way. |
Click a marked cell. A warning button appears to its left. Click it for what you can do:
- Convert to Number (for a number stored as text).
- Copy Formula from Above or Copy Formula from Left (for an inconsistent formula).
- Select Obstructing Cells (for a spill).
- Show Calculation Steps… opens Evaluate Formula.
- Ignore Error takes the mark off.
- Edit in Formula Bar.
To go through all the marked cells on a sheet, click Formulas ▸ Formula Auditing ▸ Error Checking. The dialog shows each cell, its formula and what's wrong, with a button to fix it, Ignore Error and Edit in Formula Bar. Use Previous and Next to move between cells. When none are left, Ganit says "The error check of the entire sheet is complete."
Click the arrow beside Error Checking for Trace Error. On a cell that shows an error, it draws arrows back to the cells the error comes from, with the ones that hold errors in red.
Evaluate Formula¶
Evaluate Formula works a formula out one step at a time, so you can see where it goes wrong.
- Click the cell with the formula.
- Click Formulas ▸ Formula Auditing ▸ Evaluate Formula.
- The part to work out next is underlined. Click Evaluate to work it out.
- Keep clicking until the result shows. Restart starts again.
For example, with 5 in A61, =IF(A61>3,A61*18%,0) goes through =IF(5>3,A61*18%,0), =IF(TRUE,A61*18%,0), =A61*18%, =5*18%, =5*0.18 and ends at 0.9.
Watch Window¶
The Watch Window keeps chosen cells' values in view while you work elsewhere, even on other sheets. Use it to watch a bill's total while you change rates on a price list.
- Click Formulas ▸ Watch Window.
- Select the cells to watch and click Add Watch…. Check the reference and click Add.
The window lists each cell's Sheet, Name, Cell, Value and Formula. Double-click a row to go to its cell. To stop watching a cell, click its row and click Delete Watch. Drag the window by its title to move it, and click ✕ to close it.
Error values¶
When a formula can't give a result, the cell shows an error value:
| Error | What it means | Example |
|---|---|---|
| #DIV/0! | Dividing by zero or by an empty cell. | =10/0 |
| #N/A | A lookup didn't find the value. | =VLOOKUP("Milk", A2:C5, 3, FALSE) when Milk isn't in the list |
| #VALUE! | The wrong kind of value, such as text where a number is needed. | ="abc"+1 |
| #REF! | A cell that doesn't exist: its row, column or sheet was deleted, or an index is outside the range. | =INDEX({1,2}, 5) |
| #NAME? | A function or name Ganit doesn't know, often a spelling mistake. | =SUMM(1) |
| #NUM! | A number that can't be worked out. | =SQRT(-1) |
| #SPILL! | The result can't spill because cells are in the way. | |
| #CALC! | The calculation gave nothing, such as a FILTER that matched no rows. | =FILTER({1,2}, {FALSE,FALSE}) |
To show something else in place of an error, wrap the formula in IFERROR or IFNA: =IFERROR(B2/C2, 0) shows 0 when C2 is empty, and =IFNA(VLOOKUP(A2, Rates, 2, FALSE), "Not found") shows a message when the item isn't in the list.
Circular references¶
A circular reference is a formula that uses its own cell, directly or through other cells. For example, A1 is =B1+1 and B1 is =A1*2.
Ganit can't work these out. The status bar shows Circular References, and the formulas in the loop don't give correct results: Ganit counts the cell that closes the loop as 0. Use Trace Precedents on the cells to find the loop, and change one formula so it no longer uses its own result.
Calculation¶
Ganit works formulas out by itself whenever a cell they use changes. There's no manual calculation mode.
Formulas ▸ Calculation ▸ Calculate Now (F9) works everything out again. Use it to bring NOW and TODAY up to the current time, or to get new RAND and RANDBETWEEN numbers.