Reshape

Compute new columns from existing ones with formulas or expressions

Create new columns derived from existing columns using arithmetic, string, or conditional expressions.

🛡️ Your rows never leave your browser.
Why Onfyt: Supports Excel-style IF expressions (`IF(revenue > 5000, 'high', 'normal')`) in the browser without needing Excel.

Interactive Sample Data

idnamerevenuecost
1Grace Kerubo45002100
2Peter Njoroge32001800

How this tool works

Adding derived columns is a core ETL operation. Rather than exporting to Excel, writing a formula in a new column, and re-exporting, DataFix applies the formula directly to your CSV in-browser. The expression language supports arithmetic operators (+, -, ×, ÷, %), string concatenation, numeric comparisons, and IF/ELSE conditional logic. Expressions reference column names directly: `revenue - cost` uses the values in those columns for each row. The result is appended as a new named column. Data enrichment often requires computing new columns derived from existing fields, such as concatenating first and last names, computing profit margins from revenue and cost, or generating full URLs from domain names. DataFix provides an in-browser formula engine that executes mathematical formulas, string operations, and logical conditions across every row, populating your new calculated column with complete precision. Deriving composite metrics—such as calculating net margins from gross revenue and expense fields or concatenating geographical codes—enriches raw data for reporting. Our formula evaluator processes row-level computations with complete numeric precision. Evaluating row-level mathematical expressions and string concatenations creates enriched derived attributes, such as computing total order value from unit price and quantity. Our formula evaluator handles numeric precision and null fallbacks with complete reliability.

Things that usually go wrong

  • Division by zero produces 'Infinity' or 'NaN' — use an IF formula to handle zero denominators.
  • Column names with spaces must be quoted: price per unit (use backtick or bracket notation).

Edge cases we tested

🧪 Division by zero (cost = 0)

Returns empty string or Infinity depending on user preference setting.

🧪 String concatenation of a numeric column

Number coerced to string before concatenation ('Grace' + 4500 = 'Grace4500').

🧪 IF expression referencing non-numeric column

String comparison used; equal/not-equal supported on text values.

Frequently Asked Questions

What math functions are available?

abs, round, floor, ceil, sqrt, log, max, min, pow, and all JavaScript Math methods.

Can I use IF/ELSE logic?

Yes — use: if (status == 'active') { price * 0.9 } else { price }

Related tools

Reshape

Transpose CSV

Flip a CSV matrix by turning rows into columns and columns into rows.

Open Tool →
Reshape

Pivot a CSV

Summarise long-format CSV data into pivot tables grouped by row and column keys.

Open Tool →
Reshape

Group By and Count

Aggregate CSV rows by one or more group-by columns with count, sum, mean, min, or max.

Open Tool →