Free browser tool

Calculated CSV Column

Load a CSV or XLSX file and append one column. The formula names columns that already exist and uses addition, subtraction, multiplication, division, and parentheses on the current row only. The download stores that static text, not an Excel formula.

Add a calculated column

Load a CSV or an XLSX worksheet, type a formula that names existing columns, and choose a new column name. A selected file is used instead of pasted text. Click Load data again after you change the delimiter. Nothing is uploaded.

Choose a CSV or XLSX file, or paste CSV, to start.

The download keeps every loaded row and adds one static column at the end. A referenced cell counts only when it is a plain number. Blanks, words, currency symbols, percent signs, and thousands separators stay out of the arithmetic and are not treated as zero. Division by zero leaves that new cell blank. Limits: 10 MB, 100,000 data rows, and 1,000 columns including the new one. The formula can be up to 2,000 characters, and the new name can be up to 200 characters. The preview shows up to 12 rows; the CSV download includes every row.

One new column for the current row

This page appends one column. It reads each data row on its own, writes one static value, and keeps the row even when that value is blank. It does not edit cells, fill a range, or store a formula that recalculates later. The formula cannot name the new column, because that column does not exist until the pass finishes, and this page does not run a second pass.

A grouped sum belongs on the pivot chart tool. This page does not group rows. It also does not filter them. Filter CSV by column conditions is a separate page. The CSV viewer can edit a cell, but it does not calculate a new column from other columns.

Column names and arithmetic

Write an existing column name between square brackets. [Width] matches the header Width. It does not match width, and it does not match Width with an extra space. Spaces inside the brackets are part of the name. A number written without brackets, such as 2, is a constant. [2] means a column whose header is the character 2. The formula must name at least one column, so 1 + 2 is rejected.

The operators are + - * and /. * and / are applied before + and -. Operators at the same level run from left to right. [Width] / 2 / 2 divides by 2, then divides that result by 2. When Width is 8, the new cell is 2. Parentheses change the order. ([Width] + [Height]) * 2 on the tile row below is (2 + 3) * 2, which is 10. A leading minus is allowed, as in -[Width]. Writing two values next to each other is an error. It is not multiplication. This page does not accept functions, comparisons, cell addresses such as A1, or a reference to another row.

When the file loads, a blank header becomes Column 1, Column 2, and so on, using the column position. When two headers are the same, the first is kept and the later one is renamed. A second Width becomes Width (2). The formula must use that renamed header. A header that contains ] cannot be named, because ] ends the name. Rename that column in the source file if you need to use it.

Worked example

Input header Item, Width, Height. Rows: tile 2 3, panel 10 4, label n/a 1, spacer with an empty Width and Height 5, strip 1.5 2.

Use example rows applies [Width] + [Height] * 2 and names the new column Calculated. Multiplication happens before addition. tile is 2 + 3 * 2, which is 8. panel is 10 + 4 * 2, which is 18. label has n/a in Width, so Calculated is blank. spacer has an empty Width, so Calculated is blank. strip is 1.5 + 2 * 2, which is 5.5. The download keeps all five rows. It does not drop the blank results, and it does not turn n/a into zero.

On the tile row, [Width] / [Height] is 2 / 3, and the new cell is 0.6666666666666666. The example button does not use that formula. Results are JavaScript numbers written as text. This page does not round them to a fixed number of decimal places. A value such as 0.1 plus 0.2 is stored as 0.30000000000000004.

Plain numbers, blanks, and division

A referenced cell is used only when trimming its ends leaves a plain number: an optional plus or minus, digits, an optional decimal point, and an optional exponent such as 1e2. The exponent form 1e2 is the number 100, so the new cell is written as 100. The text 10.0, 010, and 1e1 all become 10 in the calculation. The original cell is still copied unchanged. Only the new cell uses the calculated text. Negative zero is used as zero.

If any referenced cell on the row is not a plain number, the new cell is blank. Blank cells, words, currency symbols, percent signs, and thousands separators do not count. n/a, $5, 5%, and 1,000 leave the new cell blank. They are not used as zero. That blank reason wins even when another part of the formula would divide by zero. When every referenced cell is a plain number but a divisor is zero, the new cell is blank too. It is not Infinity. A result that is too large to be a finite JavaScript number, such as 1e308 * 10, is also blank. It is not written as Infinity or NaN.

CSV and XLSX input

Paste CSV or choose a .csv, .tsv, or .txt file. The first non-empty record is the header, and the rows under it are the records. Quoted fields can contain the delimiter and doubled quotes. An unclosed quote stops the load with an error and no result table. Automatic delimiter detection looks at the header line and chooses among comma, semicolon, tab, and pipe. If the columns land in the wrong places, pick the delimiter and click Load data again. CSV text is read as UTF-8. Completely blank records are skipped before the calculation.

An .xlsx workbook is read on this page as Office Open XML. After it loads, the worksheet list shows every sheet named in the file, with the first sheet selected. Switch sheets to calculate that sheet instead. Older binary .xls workbooks are not read; save them as .xlsx or CSV first. The reader uses the value stored in the cell. A formula contributes that stored value when the file contains one, and this page does not recalculate the workbook formula. Excel dates that were saved as serial numbers stay numbers. See Microsoft's file formats supported in Excel for the difference between .xlsx and older workbooks, and the CSV format specification, RFC 4180, for quoting.

What the download contains

The preview lists at most 12 data rows, in file order, including rows whose new cell is blank. The CSV download contains every loaded row, including rows past the preview. The original columns stay in their original order and keep their original text. The new column is last. Spaces at the ends of the new column name are removed. If that name matches a header already in the file, Add column stops with an error and does not overwrite the column. Changing the formula, the new name, or the loaded sheet clears the previous download until you click Add column again.

The saved file is CSV text. Opening it in a spreadsheet does not create a calculated column that updates when an input changes. There is no account, and the file is not sent to a server for the calculation. Very large sheets still use memory on your device. Files over 10 MB, tables over 100,000 data rows, or tables that already have 1,000 columns stop with an error instead of a partial column. Search volume for this page has not been verified.

Frequently asked questions

Does the download contain an Excel formula?

No. Each new cell is the static text calculated for that row, or it is blank. The CSV does not contain a formula, and this page does not create a spreadsheet column that recalculates later.

What happens when a cell is blank or not a plain number?

The new cell on that row is blank. Blank cells, n/a, currency symbols, percent signs, and thousands separators are not treated as zero.

Can the formula use another row or a range?

No. Each result uses only the current row. There is no range, no sum of a column, and no reference to the row above.

Are column names case sensitive?

Yes. [Width] matches Width only. Spaces inside the brackets are part of the name. A second header with the same text is renamed, such as Width (2), and the formula must use that name.

Can the new column replace an existing column?

No. If the name matches a header already in the file, Add column stops with an error. This page appends a column and does not overwrite one.

Is the spreadsheet uploaded?

No. The browser reads the file on your device. Closing the tab clears the working table unless you downloaded the CSV.