October 17, 2026

Loan payments, logic and more: the math Excel users expect

A calculator builder that stops at + − × ÷ and if runs out of road fast. A loan quote needs a monthly payment. An eligibility check needs “and” and “at least”. A packing calculator needs a remainder. These are things people reach for in Excel without thinking, so we added them.

Loan and savings maths

pmt, fv and pv work the way Excel’s do. Give the rate per period, the number of periods and an amount:

.input loan: Loan (RM) positive
.input rate: Yearly interest (%) positive
.input years: Years positive
.r1 Monthly payment (RM): abs(pmt(rate ÷ 100 ÷ 12, years × 12, loan))

A 200,000 loan at 5% over 30 years gives 1,073.64 a month. Signs follow Excel: money you pay out is negative, so pmt returns a negative number and abs() makes it plain. The same goes for fv, what regular savings grow to, and pv, what a stream of payments is worth today. 200 a month for 5 years at 4% is fv(0.04 ÷ 12, 5 × 12, 0 − 200), which is 13,259.80.

Logic

if conditions can now be joined with and, or and not, and compared with >=, <= and <> (shown as ≥ ≤ ≠):

.input age: Age positive
.input income: Monthly income (RM) positive
.r1 Can apply: age >= 18 and age <= 65 and income < 5000

A formula made only of comparisons gives true or false, which is what an eligibility calculator needs. not goes first, then and, then or, and brackets group.

Whole numbers and logs

  • mod(a, b), the remainder, with the sign of b like Excel. mod(10, 3) is 1.
  • floor(x) and ceil(x) round down and up to a whole number. Boxes needed for 37 items, 12 to a box, is ceil(37 ÷ 12).
  • exp, ln and log (base 10), accurate to about 30 digits.

Lists

count, product, lowest and highest join sum, mean, median and the rest. sumproduct(list1, list2) multiplies two lists item by item and adds them up, which is a weighted total in one step.

Still exact

Every one of these runs in the same Rust/WASM decimal engine as the rest of tinymath, with numbers kept as decimal strings. 0.1 + 0.2 is still 0.3.

Each function is in the Dotdown™ functions guide, with an example. You can type them into the builder’s Dotdown™ box or add them as blocks.

What isn’t there yet: dates, text and lookups like VLOOKUP. Those need more than numbers, so they are a bigger change than a function.

← All posts