How a formula is written
A formula is one line that candl works out for each record. This page lists what you can put in it. To add a calculated field to a dataset, see Calculated fields in datasets; the same formulas work in a report’s formula columns.
- Columns
- A column of the record is its name in square brackets:
[First Name]. Capitals do not matter, so[first name]finds the same column. A column that does not exist reads as blank. - Text
- Text goes in quotes,
"Paid"or'Paid'. Join text with&:[First Name] & " " & [Last Name]. - Numbers
- Write them plainly,
0.9or500, and use+ - * /and brackets. A column holding$1,200or1200is read as a number. - Comparing
= <> < <= > >=, combined withAND,ORandNOT. Text comparisons ignore capitals, so[Status] = "paid"matches Paid. Numbers and dates compare as numbers and dates, not as text.- Yes and no
TRUEandFALSEare understood. A column counts as no when it is empty or says No, False, N or 0; anything else counts as yes. A yes or no result is saved as Yes or No.- Blanks
- An empty column counts as 0 in arithmetic, so
[Fee] - [Paid]works when nothing was paid, and dividing by zero gives 0 rather than an error.SUM,AVG,MINandMAXskip blanks instead.BLANKis an empty value, andISBLANKandIFBLANKtest for one. - Dates
- Dates are read as written on the school calendar, with no time zone shifting them:
2026-12-25,12/25/2026andDec 25 2026all work. Subtract one date from another for the days between, or useDAYS,MONTHSandYEARS. A date result is saved as2026-12-25; useFORMATDATEto write it your way. - Mistakes
- A formula with a mistake, such as an unclosed quote or a function candl does not know, shows Needs fixing with what is wrong. Capitals in function names do not matter.
COALESCE works like IFBLANK, AVERAGE like AVG, CEILING like CEIL and SUBSTITUTE like REPLACE. The tables below show the main names.Logic
Choose between values, and test for blanks.
| Function | What it does | Example |
|---|---|---|
IF(test, then, else) | One value when the test is true, another when it is not. | IF([Balance] > 0, "Owes " & [Balance], "Paid") |
IFS(test1, value1, test2, value2, ..., else) | The value of the first test that is true. | IFS([Grade] >= 90, "A", [Grade] >= 80, "B", "C") |
SWITCH(value, match1, result1, ..., else) | Looks a value up in pairs. | SWITCH([Shiur], "A", "Aleph", "B", "Beis", "Other") |
AND(a, b, ...) | True when every part is true. Also written a AND b. | AND([Balance] > 0, [Paid] = "No") |
OR(a, b, ...) | True when any part is true. Also written a OR b. | OR([Status] = "New", [Status] = "Late") |
NOT(a) | The opposite. | NOT(ISBLANK([Email])) |
ISBLANK(value) | True when the value is empty. | ISBLANK([Allergies]) |
IFBLANK(value, otherwise, ...) | The first value that is not empty. | IFBLANK([Nickname], [First Name]) |
ISNUMBER(value) | True when the value reads as a number. | ISNUMBER([Room]) |
Numbers
Arithmetic, rounding and money.
| Function | What it does | Example |
|---|---|---|
ROUND(number, places) | Rounds; places defaults to 0. | ROUND([Fee] / 3, 2) |
FLOOR(number) | Rounds down. | FLOOR([Score] / 10) |
CEIL(number) | Rounds up. | CEIL([Nights] / 7) |
ABS(number) | Without its sign. | ABS([Paid] - [Fee]) |
MIN(a, b, ...) | The smallest. | MIN([Balance], 500) |
MAX(a, b, ...) | The largest. | MAX(0, [Due] - [Paid]) |
SUM(a, b, ...) | Adds them, skipping blanks. | SUM([Q1], [Q2], [Q3]) |
AVG(a, b, ...) | The average, skipping blanks. | AVG([Q1], [Q2], [Q3]) |
MOD(a, b) | The remainder of a divided by b. | MOD([Seat], 2) |
NUMBER(value) | The number in a text, such as $1,200. | NUMBER([Amount]) |
CURRENCY(number) | As money: $1,234.50. | CURRENCY([Balance]) |
NUMBERFORMAT(number, places) | With thousands separators. | NUMBERFORMAT([Total], 0) |
Text
Join, cut and search text. Positions count from 1.
| Function | What it does | Example |
|---|---|---|
CONCAT(a, b, ...) | Joins them. Also written a & b. | CONCAT([First Name], " ", [Last Name]) |
JOIN(separator, a, b, ...) | Joins the values that are not blank. | JOIN(", ", [City], [State]) |
UPPER(text) | IN CAPITALS. | UPPER([Last Name]) |
LOWER(text) | in small letters. | LOWER([Email]) |
PROPER(text) | Each Word Capitalized. | PROPER([Name]) |
TRIM(text) | Without spaces at the ends, and single spaces inside. | TRIM([Address]) |
LEFT(text, count) | The first characters. | LEFT([First Name], 1) |
RIGHT(text, count) | The last characters. | RIGHT([Phone], 4) |
MID(text, start, count) | Characters from a position, counting from 1. | MID([Code], 2, 3) |
LEN(text) | How many characters. | LEN([Notes]) |
REPLACE(text, find, with) | Every find replaced. | REPLACE([Phone], "-", "") |
CONTAINS(text, part) | True when the part appears, ignoring case. | CONTAINS([Notes], "allergy") |
STARTSWITH(text, part) | True when it begins with the part. | STARTSWITH([Room], "B") |
ENDSWITH(text, part) | True when it ends with the part. | ENDSWITH([Email], "@nirc.edu") |
SPLIT(text, separator, n) | The nth piece, counting from 1. | SPLIT([Full Name], " ", 1) |
INITIALS(text) | The first letter of each word. | INITIALS([Name]) |
TEXT(value) | As text. | TEXT([Forms]) & " forms" |
Dates
Today, parts of a date, moving a date, and the time between two dates.
| Function | What it does | Example |
|---|---|---|
TODAY() | Today. | DAYS([Due Date], TODAY()) |
NOW() | This moment. | FORMATDATE(NOW(), "h:mm a") |
DATE(text) or DATE(year, month, day) | A date from text, or from its parts. | DATE(2026, 9, 1) |
YEAR(date) | The year. | YEAR([Birth Date]) |
MONTH(date) | The month, 1 to 12. | MONTH([Start]) |
DAY(date) | The day of the month. | DAY([Start]) |
WEEKDAY(date) | The day of the week, 1 (Sunday) to 7. | WEEKDAY([Date]) |
DAYNAME(date) | Sunday, Monday ... | DAYNAME([Date]) |
MONTHNAME(date) | January, February ... | MONTHNAME([Date]) |
ADDDAYS(date, days) | A date some days later (or earlier, with a minus). | ADDDAYS([Submitted], 14) |
ADDMONTHS(date, months) | A date some months later. | ADDMONTHS([Start], 6) |
ADDYEARS(date, years) | A date some years later. | ADDYEARS([Birth Date], 13) |
DAYS(from, to) | Days from one date to the other. | DAYS([Submitted], TODAY()) |
MONTHS(from, to) | Whole months between them. | MONTHS([Start], TODAY()) |
YEARS(from, to) | Whole years between them: an age. | YEARS([Birth Date], TODAY()) |
FORMATDATE(date, pattern) | A date written your way: "MMM d, yyyy", "EEEE", "MM/dd". | FORMATDATE([Due Date], "MMMM d, yyyy") |
When a date looks wrong
Most wrong dates come from how candl reads the text in the column.
- The date comes out blank
- candl could not read it as a date. It reads
2026-12-25(with or without a time),12/25/2026and12/25/26, and written dates such asDec 25 2026. A plain number, such as a date a spreadsheet stored as46000, is not read as a date.DATEgives blank for text it cannot read, andFORMATDATEgives nothing. - Day and month are swapped, or the year is off
- A date with slashes is always month first,
12/25/2026. Day first, such as25/12/2026, is not understood: the 25 is read as a month and the date lands in the next year. Change the column to month first, or build the date from its pieces withDATE(year, month, day). A two-digit year is read as 20 and the digits, so12/25/26is 2026. - A date column that is really text
- A formula reads whatever the column holds. A date stored as text works if the text is in a form above; words, or a date with extra text around it, do not. A date a formula saves looks like
2026-12-25, with the time added only when there is one. - The pattern in
FORMATDATEgives the wrong thing - Capitals matter.
MMis the month andmmthe minutes,ddthe day of the month,yyyythe year,h:mm athe time with AM or PM."MMM d, yyyy"gives Dec 25, 2026 and"EEEE"gives the weekday. A pattern candl cannot read shows an error naming it. TODAYis not today- It is the date on the school calendar when the formula is worked out. A calculated field in a dataset is worked out when rows arrive and when the dataset’s settings are saved, then kept, so an age or a count of days is as of that moment and does not change by itself each morning.
- A date is one day off
- Dates are read as written, with no time zone shifting them, so a plain date does not move. Only a text that carries its own time zone, such as one ending in
Zor+00:00, is converted to the school’s time (Eastern), and a late evening hour there can land on the next or the previous day.
Many rows
For a form that holds many rows for one person, such as a schedule with one row per appointment. A column from such a form normally arrives as every row joined into one piece of text. MATCHING reads the rows one by one instead, so a time can be paired with the teacher on the same row.
| Function | What it does | Example |
|---|---|---|
MATCHING([values], [match column], find1, find2, ...) | For a form with many rows per person: the values from the rows whose match column contains any of the finds, ignoring case. | MATCHING([Time], [Name], "Gerstein", "Berger") |
Recipes
Each of these was run through candl’s own formula engine. The columns in the examples are made up; use your own column names.
An age from a birthday
Whole years between the birthday and today.
YEARS([Birth Date], TODAY())
A birthday of 2010-03-15 on November 20, 2026 gives 16. A birthday of 2010-12-15 on the same day gives 15, because the birthday has not come yet this year.
A full name
JOIN skips a blank piece, so a missing middle name leaves no double space, and PROPER tidies the capitals.
JOIN(" ", PROPER([First Name]), PROPER([Middle]), PROPER([Last Name]))levi, a blank middle name and COHEN give Levi Cohen. For a “last, first” list, use [Last Name] & ", " & [First Name], which gives Cohen, Levi.
A fee with a sibling discount
Ten percent off when the student has at least one sibling enrolled, written as money.
CURRENCY(IF([Siblings] >= 1, [Fee] * 0.9, [Fee]))
A fee of 1000 with 2 siblings gives $900.00. With the Siblings column empty it gives $1,000.00.
A grade letter from a number
IFS takes the first test that is true, so list the highest cutoff first. The last value is used when no test is true.
IFS([Score] >= 90, "A", [Score] >= 80, "B", [Score] >= 70, "C", [Score] >= 60, "D", "F")
A score of 85 gives B. A score of 59 gives F.
Days until a date
DAYS(TODAY(), [Due Date])
On November 20, 2026 a due date of 2026-12-25 gives 35. A date that has already passed gives a negative number.
A yes or no from a checkbox
Turn a form answer into the exact words you want on a letter.
IF([Permission Slip], "Received", "Still needed")
An answer of Yes gives Received. An answer of No, or an empty one, gives Still needed.
A date two weeks out, written out
FORMATDATE(ADDDAYS([Submitted], 14), "MMMM d, yyyy")
A submitted date of 2026-11-20 gives December 4, 2026.
The time of one teacher’s appointment
A parents day form has one row per appointment, with a Time column and a Name column holding the teacher. This finds the time of the row for either of two teachers and shows it as a time of day. When neither teacher has a row, it says so.
IFBLANK(FORMATDATE(MATCHING([Time], [Name], "Gerstein", "Berger"), "h:mm a"), "No appointment")
With rows Nov 22 6:24 PM for Mr. Johnson and Nov 22 4:30 PM for Rabbi Gerstein, it gives 4:30 PM. A name is matched by any part of it, ignoring capitals. Where the person has no matching row, it gives No appointment. When one match is a date it stays a date, so FORMATDATE works on it. When several rows match, MATCHING joins their values with commas (Nov 22 4:30 PM, Nov 22 5:00 PM) and that is text, not a date, so leave FORMATDATE off if a person can have two appointments with the teachers you name.
A phone number with only digits
REPLACE([Phone], "-", "")
555-123-4567 gives 5551234567.