Trigonometry, Logarithms, and Complex Numbers in Google Sheets
July 24th, 2026
Most spreadsheets never go past SUM and VLOOKUP, but Google Sheets ships a full scientific toolkit underneath: trig functions for angles and geometry, logarithmic and exponential functions for growth curves, and even a small complex-number and matrix library for engineering-style math. None of it is exotic once you know two things that trip people up immediately: angles are in radians, not degrees, and complex numbers are stored as text, not as a native number type.
Angles are radians, not degrees
Every trig function in Sheets — SIN, COS, TAN, and their inverses — expects radians. If you type an angle in degrees and feed it straight into SIN, you'll get a mathematically correct but practically wrong answer.
=SIN(45)
That computes the sine of 45 radians (about 2578 degrees after wrapping), not 45 degrees. To convert:
=SIN(RADIANS(45))
RADIANS(45) returns 0.7853981634, and SIN of that gives 0.7071067812 — the sine of a true 45° angle. Going the other direction, DEGREES() converts a radian result back to something readable:
=DEGREES(ATAN(1))
This returns 45, since the arctangent of 1 is π/4 radians. Keep this conversion pair close whenever you're mixing spreadsheet math with real-world angles from a protractor, a CAD drawing, or GPS bearings.
Finding the angle between two points with ATAN2
A common geometry task is: given two points, what's the angle of the line connecting them? ATAN alone can't do this reliably because it doesn't know which quadrant the point falls in — ATAN2 does, since it takes both the x and y differences as separate arguments.
Suppose column A/B hold the coordinates of a reference point and C/D hold a target point:
=DEGREES(ATAN2(C2-A2, D2-B2))
If the reference is at (0, 0) and the target is at (3, 4), ATAN2(3, 4) returns 0.9272952180 radians; wrapped in DEGREES(), that's 53.13° — the bearing from the origin to (3, 4), correctly signed no matter which quadrant the target sits in. This pattern shows up constantly in robotics (pointing a turret at a target), navigation (computing heading from two GPS fixes), and simple physics simulations (the angle of a resultant velocity vector from its x/y components).
Logarithms for growth and scale
LOG and its relatives turn multiplicative relationships into additive ones, which is exactly why they show up in compound growth, decibels, pH, and Richter-scale style problems.
To find how many years it takes an investment to double at a given annual rate, you solve for the exponent in (1 + rate)^years = 2, which means taking a log of both sides:
=LOG(2, 1+B2)
With B2 at 0.07 (a 7% annual rate), this returns roughly 10.24 years — the classic "rule of 72" made exact. LOG(value, base) computes a log in any base; omit the second argument and it defaults to base 10.
For continuous growth — the kind compounding constantly rather than annually — you want the natural logarithm, LN, and its inverse, EXP:
=LN(B2/A2)/C2
If A2 is a starting population, B2 the population C2 years later, this recovers the continuous growth rate r such that B2 = A2 * EXP(r * C2). To project forward instead of solving backward:
=A2*EXP(0.03*10)
That grows a starting value in A2 at a continuous 3% rate for 10 years. Log scales also show up whenever raw numbers span several orders of magnitude — sound intensity, pH, earthquake energy — where LOG(value) compresses a huge range into something a chart or a comparison can actually show.
Complex numbers: IMREAL, IMAGINARY, and COMPLEX
Sheets represents a complex number as a text string like "3+2i" rather than as a numeric pair, and a whole IM* function family (IMSUM, IMPRODUCT, IMABS, and so on) operates on that string. COMPLEX builds one from its two parts:
=COMPLEX(3, 2)
This returns the text "3+2i". Going the other way, IMREAL and IMAGINARY pull the components back out of a complex-number string — handy once you've combined complex numbers and need to plot or format the result:
=IMREAL(A2)
=IMAGINARY(A2)
If A2 holds "3+2i", these return 3 and 2 respectively. A typical use case is electrical engineering, where AC impedance is naturally a complex number (resistance as the real part, reactance as the imaginary part). You might compute a combined impedance with IMSUM or IMPRODUCT, then split it back into real and imaginary parts with IMREAL/IMAGINARY for a chart or a report that shouldn't show raw complex-number text to a non-technical reader.
Matrix operations: MDETERM and MINVERSE
For anything involving systems of linear equations — structural load calculations, circuit analysis via Kirchhoff's laws, or least-squares fitting — Sheets has array-native matrix functions. MDETERM returns a matrix's determinant, which tells you whether a system even has a unique solution:
=MDETERM(A2:C4)
If this returns 0, the matrix is singular and the system has no unique solution — worth checking before you trust anything downstream. Assuming a nonzero determinant, MINVERSE computes the inverse matrix, which lets you solve A·x = b by computing x = A⁻¹·b:
=MMULT(MINVERSE(A2:C4), E2:E4)
Entered as an array formula, this solves a 3-variable linear system in one step — no manual elimination, no separate solver add-on. It's the same math behind solving for currents in a resistor network or forces in a statically determinate truss, just expressed as spreadsheet ranges instead of textbook notation.
Bringing it together
None of these functions are hard in isolation; the friction is almost always unit mismatch — radians versus degrees, or text-encoded complex numbers versus plain numbers. Once RADIANS/DEGREES and IMREAL/IMAGINARY are part of your muscle memory, Sheets holds up surprisingly well as a lightweight engineering calculator: angle and vector geometry with SIN/COS/ATAN2, growth and scaling with LOG/LN/EXP, and linear systems with MDETERM/MINVERSE, all without leaving the grid.