Skip to main content

Add a Calculated Column

Add a calculated column to Excel, CSV, or JSON data with a safe arithmetic formula such as [price] * [quantity], preview the values, and export the result.

  • Export
Automate

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Add a calculated column from numeric values in other columns using a safe arithmetic formula.

Your files are processed locally in your browser and are never sent to our servers.

Drop your file here

Recommended size: up to 30 MB

Options

Reference columns in brackets, for example [price] * [quantity]. Supported operators: +, -, *, /, %, parentheses.

Was this tool useful?

How does this tool work?

A calculated column adds a result derived from other cells in each record: a quantity's amount, a difference between measurements or a ratio between two values. The same expression is evaluated separately for every record without executing user-supplied JavaScript. Use it to prepare a value before filtering, aggregation or export. It does not replace a full spreadsheet: Excel functions, cross-row references and text formulas are outside its arithmetic language. You obtain concrete calculated values while retaining the source records that explain how those results were produced.

Import CSV, TSV, XLSX, XLS or flat tabular JSON, with a 30 MiB file limit. Workbooks use their first sheet; this interface does not offer a sheet selector. Workbook formatting and macros are not preserved, and its formulas are not recalculated as they would be in Excel. Choose a new destination name because an existing column cannot be overwritten. Surrounding spaces are removed from the destination name before checking whether it already exists in the imported table.

Write references in square brackets, such as [price] or [unit price], matching imported names and case. Supported operators are +, -, *, / and %, together with unary signs and parentheses. Multiplication, division and remainder take precedence over addition and subtraction. The % character means remainder, not percentage. Numerical constants in the expression use a decimal point even when source cells use decimal commas. Function calls and exponentiation operators are not accepted. Parentheses make the intended evaluation order explicit rather than relying on a reader's guess.

Referenced cells are converted to finite numbers, recognising decimal points or commas and supported thousands spaces. Missing, empty or non-numerical cells produce null for that record, as do division or remainder by zero. A final infinite or non-numerical result also becomes null. An unknown column reference or malformed expression instead prevents the entire calculation. Preview and CSV or XLSX exports retain every record; null appears empty in tabular output. The new column contains calculated values, not live Excel formulas, and existing source cells are not rewritten by arithmetic evaluation.

How to use this tool

  1. Inspect source names and numerical cells

    Place the intended sheet first in the workbook or prepare a dedicated export. Read exact headings and verify that required cells contain interpretable numbers rather than currency symbols or other annotations.

  2. Name the result and enter its expression

    Choose a destination not already present. Use bracketed references, keyboard operators and decimal-point constants. Add parentheses wherever they make the intended arithmetic order clearer to another person reviewing the transformation.

  3. Review missing results before exporting

    Run the calculation and compare selected outputs with their inputs, including an empty cell or zero denominator. Export CSV or XLSX values only after understanding why any calculated cells were left empty.

Two verified record-level calculations

These expressions correspond to executed examples, not extra language functions. p is a unit price and q a compatible quantity; T retains the price currency. C and R represent cost and revenue in the same unit. Their ratio is dimensionless and becomes a percentage when multiplied by 100.

Record amount

T = p × q

The same multiplication is applied to each product without adding values from other records.

Cost share of revenue

r = 100 × C / R, R ≠ 0

A zero denominator cannot produce a proportion, so that calculated cell remains empty.

Use cases

Compute an amount for each product

Multiply unit price by quantity before grouping sales. First confirm that prices share the same currency and that quantities use units compatible with the stated unit prices in your source export.

Compare measurements within one record

Add the difference between an observed and reference value, then locate records requiring inspection without accidentally combining measurements from separate rows that represent different observations or entities.

Prepare a reusable proportion

Calculate a cost share from two columns and review zero denominators before interpreting empty results. The numerical output does not automatically include a percentage sign or special percentage formatting.

Examples

Add a total for every reference

The expression [price] * [quantity] creates total. A receives 50 and B receives 24. Prices are interpreted numerically while source cells remain present. This operation does not sum the two records together or create a grouped total.

Input

reference;price;quantity
A;12.50;4
B;8.00;3

Result

reference;price;quantity;total
A;12.50;4;50
B;8.00;3;24

Leave an undefined ratio empty

With [cost] / [revenue] * 100 and destination cost_share, X receives an empty result because its revenue is zero. Y receives 60. Other fields remain available to investigate the absence or use the numerical share in a later filter.

Input

product;revenue;cost
X;0;20
Y;100;60

Result

product;revenue;cost;cost_share
X;0;20;
Y;100;60;60

Tips and best practices

  • Rename a source column containing a closing square bracket before referencing it. The expression language provides no escape syntax for including that character inside a bracketed column name without ending the reference.
  • Currency labels and percentage signs do not form valid numerical input cells. Clean those annotations separately and clarify the units before comparing or multiplying values that might otherwise describe incompatible quantities.
  • Arithmetic uses JavaScript floating-point numbers without a built-in accounting rounding policy. When output must follow a specific monetary rule, apply and verify that policy in a suitable subsequent step rather than assuming the tool rounds automatically.

Frequently asked questions

Can I use SUM, IF or an existing Excel expression?

No. The language supports current-record references, numbers, arithmetic operators and parentheses. It does not execute Excel functions or JavaScript calls. For grouped totals, choose aggregation rather than trying to reference other records through a row-level expression.

Why is one result empty when the expression works elsewhere?

A referenced cell may be absent, contain non-numerical text or cause division by zero. The engine keeps that record and assigns null to its result. Inspect that record's inputs instead of automatically replacing the missing result with zero.

Does % calculate a percentage discount?

No. It returns division remainder: 10 % 3 equals 1. To apply a 20% rate, use an explicit factor such as 0.2 in a multiplication. Constants inside the expression require a decimal point regardless of source-cell notation.

Will exported Excel recalculate the column when an input changes?

No. Export contains already computed numerical results rather than workbook formulas. To change inputs and obtain new values, run the transformation again or create your own formulas afterwards in the receiving spreadsheet application.

Related tools

Tools similar or complementary to this one.

Similar tools

Profile every CSV column with detected type, missing values, cardinality, and descriptive numeric statistics.

Data & spreadsheetsUse this tool

Cross a row dimension with a column dimension, then calculate count, sum, average, minimum, or maximum.

Data & spreadsheetsFeaturedUse this tool
GuideBest practicesBeginner

Split a CSV or Excel table into smaller files

Discover when to split a large table by row count or by a column value, and how to preserve a useful structure in every output file.

29 August 20261 min
GuideBest practicesIntermediate

Build a reproducible data-preparation workflow

Put cleaning, validation, filtering, merging, comparison and conversion in a sensible order, and learn when a reusable pipeline is better than isolated tools.

29 August 20262 min