To subtract in LibreOffice Calc, click an empty cell, type an equals sign, then the first cell, a minus sign and the second cell, for example =A2-B2, and press Enter. Calc has no SUBTRACT or MINUS function, so the hyphen-minus key does the work. These steps apply to current LibreOffice Calc releases on Windows, macOS and Linux. On a Mac, most shortcuts shown here with Ctrl use Command instead.
A few terms before you start
Calc formulas use the same handful of words over and over, so it helps to pin them down first.
- Formula: anything you type into a cell that starts with
=. Calc reads it as a calculation instead of plain text. Without the equals sign,A2-B2just sits in the cell as words. - Cell reference: the column letter plus row number that names a cell, such as
B4. A range of cells uses a colon between the corners, such asB2:B6. - Minuend and subtrahend: in
10-3, 10 is the minuend (the number you start with) and 3 is the subtrahend (the amount you take away). Calc’s own help pages use these words, especially for the RAWSUBTRACT function. - Input line: the long box on the Formula Bar above the column letters. It shows the formula behind the selected cell, while the cell itself shows the result.
- Fill handle: the small square at the bottom-right corner of a selected cell. Dragging it copies the cell’s formula into neighboring cells.
You don’t need any add-ons or extensions. A blank spreadsheet and a few numbers to work with are enough.
Subtract one cell from another with the minus sign
This is the method you will use most of the time. It keeps the numbers in their own cells, so the answer updates by itself whenever one of them changes.
- Type the starting number in cell A2 (for example, 250) and press Enter.
- Type the amount to take away in cell B2 (for example, 75) and press Enter.
- Click cell C2, the cell where you want the answer to appear.
- Type
=to start a formula. - Click cell A2, or type
A2. Calc adds the reference to the formula and outlines the cell in color. - Type
-(the hyphen-minus key on the main keyboard, or the minus key on the number pad). - Click cell B2, or type
B2. The cell and the Input line now read=A2-B2. - Press Enter, or click the Accept button (the check mark) on the Formula Bar. C2 shows 175.
Change A2 to 300 and C2 switches to 225 as soon as you press Enter. That automatic update is the main reason to point at cells rather than typing the numbers straight into the formula.
Order matters. =A2-B2 takes B2 away from A2, and =B2-A2 does the reverse, giving -175 with the same numbers. If an answer comes out with the wrong sign, swapping the two references is usually the fix.
You can also subtract plain numbers without any cell references. Typing =250-75 into any cell returns 175, which is handy for a quick one-off answer. You can also start a formula by pressing the + or – key on the number pad (with Num Lock on): typing +50-8 and pressing Enter stores the formula =+50-8, which shows 42.
Other ways to subtract, and when each one fits
The two-cell formula covers simple cases. Real sheets often need to take several amounts away at once, repeat the same subtraction down a column, or knock a fixed amount off a block of numbers. Each of those has a cleaner route.
Take several numbers away from one total
You can chain as many minus signs as you like. With a starting balance in B2 and three expenses in C2, D2 and E2, this formula subtracts all three:
=B2-C2-D2-E2
Calc works from left to right, so it takes C2 off B2, then D2 off that result, then E2. For a longer list, adding up the deductions first and subtracting the total is easier to read and harder to get wrong. The LibreOffice help gives this very pattern as an example:
=B8-SUM(B10:B14)
That subtracts the total of B10 through B14 from B8. If you add a new expense inside the range later, the result picks it up without any edits to the formula.
To compare two whole columns as totals, subtract one SUM from another, such as =SUM(B2:B6)-SUM(C2:C6). Parentheses also let you group part of a calculation. =(B2-C2)*0.2 finds the difference first and then takes 20 percent of it, whereas =B2-C2*0.2 would multiply C2 by 0.2 first, because multiplication is done before subtraction.
Repeat the subtraction down a whole column
When every row needs the same calculation (budget minus actual, sale price minus cost), write the formula once and copy it with the fill handle.
- Enter
=B2-C2in D2 and press Enter. - Click D2 again to select it.
- Point at the small square in the bottom-right corner of the cell border and hold the mouse button until the pointer turns into a cross-hair.
- Drag down to the last row of your data and release.
Calc copies the formula and adjusts the row numbers as it goes, so D3 holds =B3-C3, D4 holds =B4-C4, and so on. These shifting addresses are called relative references. The same thing happens if you copy D2 with Ctrl+C and paste it into other cells with Ctrl+V.
Subtract one fixed cell from every row
Sometimes the amount to take away lives in a single cell, such as a flat discount in F1. If you write =B2-F1 and drag it down, the next row becomes =B3-F2, which points at an empty cell. Lock the reference with dollar signs instead:
=B2-$F$1
The dollar signs make $F$1 an absolute reference, so every copied row still subtracts F1 while B2 shifts to B3, B4 and beyond. You don’t have to type the dollar signs yourself. While editing the formula, put the cursor on the reference in the Input line and press F4. Each press cycles through $F$1, F$1, $F1 and back to F1.
Subtract a value in place with Paste Special
Paste Special can subtract a number from a whole block of existing values without a helper column or any formulas. The original numbers are replaced with the results, so treat this as a permanent edit and save a copy of the file first if you might need the old values.
- Type the amount to subtract into an empty cell (for example, 4.50) and copy that cell with Ctrl+C.
- Select the cells you want to reduce.
- Choose Edit > Paste Special > Paste Special, or press Ctrl+Shift+V.
- If a preset button would apply settings at once, make sure Run immediately is cleared so you can set the options yourself.
- Under Selection, clear Paste all and check Numbers so only the number is applied.
- Under Operations, choose Subtract.
- Click OK. Every selected cell drops by 4.50.
The help describes the Subtract operation as taking the clipboard values away from the values already in the target cells, which is why the copied number is the subtrahend here. You can also copy a matching block of several numbers and subtract them cell by cell. In that case, check Skip empty cells if the copied block has gaps; when the box is cleared and a math operation is chosen, empty clipboard cells are treated as zero. Press Ctrl+Z right away if the result isn’t what you expected.
RAWSUBTRACT for precision checks
Calc does have one function with subtract in its name. RAWSUBTRACT subtracts a list of numbers and returns the result without smoothing away tiny roundoff errors. It arrived in LibreOffice 5.2, so any reasonably recent copy has it.
=RAWSUBTRACT(Minuend; Subtrahend 1; Subtrahend 2; ...)
It needs at least two arguments and accepts up to 254 subtrahends after the minuend. Like a chain of minus signs, it works left to right, so =RAWSUBTRACT(1;2;3;4) calculates ((1-2)-3)-4 and returns -8. Give it only one number and Calc shows Err:511, its code for a missing variable.
For everyday totals and balances, stick with the minus sign. RAWSUBTRACT is meant for people checking floating-point behavior, where seeing a leftover value in the far decimal places is the whole point. It is also specific to LibreOffice: it isn’t part of the OpenFormula standard, so a file that relies on it may not calculate the same way in other spreadsheet programs.
Choosing between the methods
| What you need | Best method | Example |
|---|---|---|
| One quick answer | Numbers typed into a formula | =250-75 |
| A result that updates when inputs change | Minus sign with cell references | =A2-B2 |
| Several deductions from one total | Chained minus signs or SUM | =B8-SUM(B10:B14) |
| The same calculation on every row | Formula plus fill handle | =B2-C2, dragged down |
| One fixed amount taken from every row | Absolute reference | =B2-$F$1 |
| Permanently reduce existing values | Paste Special, Subtract | Edit > Paste Special |
| Inspect tiny roundoff differences | RAWSUBTRACT | =RAWSUBTRACT(A2;B2) |
Subtracting dates, times and percentages
The minus sign works on more than plain numbers. Calc stores dates and times as numbers behind the scenes, which is what makes date and time subtraction possible.
Days between two dates
Put the earlier date in A2 (say 03/02/2026) and the later date in B2 (03/30/2026), then enter =B2-A2 in C2. The answer is 28 days. Calc’s date calculation help page points out that a result cell using the default format may show the answer as a date instead of a count. If C2 shows something odd like 01/27/1900, right-click it, choose Format Cells, and on the Numbers tab pick a plain number format. To turn the day count into hours, multiply it by 24; multiply again by 60 for minutes.
Hours between two times
A start time of 09:15 in A2 and an end time of 17:45 in B2 give 08:30 with =B2-A2. A full day counts as 1 in Calc, so one hour is 1/24 of a day. That’s why =(B2-A2)*24 returns 8.5, the same span as a decimal number of hours, which is easier to multiply by an hourly rate.
Overnight shifts need one extra piece. A plain subtraction from 23:30 to 01:10 comes out negative, because 01:10 is a smaller number than 23:30. The LibreOffice help suggests this formula instead:
=(B2<A2)+B2-A2
The comparison (B2<A2) returns 1 when the end time is earlier than the start time, which adds one full day before the subtraction. The result is 01:40. If your totals of hours run past 24, format the cell with the code [HH]:MM (in Format Cells, Numbers tab, Format code box) so Calc keeps counting hours instead of rolling over to the next day.
Taking a percentage off
Calc’s percent sign divides by 100, so 15% in a formula means 0.15. To take 15 percent off a price of 80 in A2, use either of these:
=A2-A2*15%
=A2*(1-15%)
Both return 68. The second form is shorter and makes it easy to point at a percentage stored in another cell, such as =A2*(1-$B$1).
Worked example: Priya’s monthly budget
Priya tracks her planned spending against what she actually spent in a small sheet. Column B holds the budget, column C the actual spending, and column D shows what’s left in each category.
| Row | A: Category | B: Budget | C: Spent | D: Left (formula) | D: Result |
|---|---|---|---|---|---|
| 2 | Rent | 1200.00 | 1200.00 | =B2-C2 | 0.00 |
| 3 | Groceries | 450.00 | 512.40 | =B3-C3 | -62.40 |
| 4 | Transport | 180.00 | 96.75 | =B4-C4 | 83.25 |
| 5 | Phone | 65.00 | 65.00 | =B5-C5 | 0.00 |
| 6 | Entertainment | 150.00 | 88.20 | =B6-C6 | 61.80 |
| 7 | Total | =SUM(B2:B6) = 2045.00 | =SUM(C2:C6) = 1962.35 | =B7-C7 | 82.65 |
Here’s how she builds it:
- She types the headings in row 1 and the categories and amounts in rows 2 through 6.
- In D2 she enters
=B2-C2and presses Enter. The result is 0.00, since rent was exactly on budget. - She drags D2’s fill handle down to D6. Calc fills in the matching formulas for each row.
- In B7 and C7 she totals each column with
=SUM(B2:B6)and=SUM(C2:C6). - In D7 she enters
=B7-C7, which shows 82.65 left for the month.
Groceries came out at -62.40. That isn’t an error. A negative result simply means she spent more than she planned, and it’s exactly what the formula should report. She can double-check the total two ways: adding up D2 through D6 (0 – 62.40 + 83.25 + 0 + 61.80) also gives 82.65, which matches D7. When two routes to the same number agree, the formulas are almost certainly right.
To make overspending jump out, she selects D2:D7, opens Format > Cells (or presses Ctrl+1), and on the Numbers tab checks Negative numbers red. The -62.40 turns red while the positive amounts stay black.
When the answer looks wrong
Most subtraction problems in Calc come down to a handful of causes. Check these in order before rebuilding anything.
The formula shows up as text
If the cell displays A2-B2 instead of a number, the equals sign is missing. Click the cell, press F2 to edit it, add = at the very start, and press Enter. Also check that you didn’t type a space before the equals sign.
#VALUE! or a result that ignores a number
Numbers pasted from websites, emails or other programs often arrive as text that only looks like a number. Depending on your settings, Calc either shows #VALUE! (its code Err:519, meaning a cell holds text where a number was expected) or treats the text in some other way. The setting lives under Tools > Options > LibreOffice Calc > Formula: choose Custom under Detailed calculation settings, then click Details to see how text is converted to numbers.
To find the culprit quickly, turn on View > Value Highlighting (Ctrl+F8). Calc colors number cells blue, text cells black and formulas green. A “number” that shows up black is stored as text. Retype it, or clear the cell and paste the value again as plain numbers. Turn Value Highlighting off afterward, because your own cell colors are hidden while it’s on.
Other error codes you might see
| What you see | What it means | Usual fix |
|---|---|---|
### | The column is too narrow to show the result. | Widen the column by dragging the divider beside its column header. |
#NAME? (Err:525) | Calc can’t recognize a name in the formula, such as a mistyped function or a wrong decimal separator. | Check spelling. A made-up function such as SUBTRACT() also triggers this. |
#REF! (Err:524) | A referenced row, column or sheet no longer exists. | Point the formula at the correct cells again, or undo the deletion. |
| Err:509 | An operator is missing, as in =2(3+4). | Add the missing sign between the values. |
| Err:508 | Parentheses don’t match. | Count opening and closing brackets. |
| Err:522 | Circular reference: the formula refers to its own cell. | Move the formula to a cell outside the range it calculates. |
The full list is on the LibreOffice Calc error codes page.
Negative numbers and the minus sign
The same key does two jobs in Calc. Between two values it subtracts; in front of a single value it makes the value negative. Subtracting a negative number therefore adds: =5-(-3) returns 8. Calc accepts =5--3 too, but the parentheses make your intent much clearer to anyone reading the sheet later.
Watch out for exponents. In Calc the negative sign is applied before the power, so =-3^2 returns 9 (the square of -3), not -9. This is documented on the Calc operators page. If you mean “subtract 3 squared,” write =-(3^2) or =0-3^2, both of which return -9.
Copied formulas point at the wrong cells
If the first row is right but the rows below show zeros or strange values after you fill down, a reference that should have stayed fixed moved with the copy. Click one of the bad cells and read its formula in the Input line. If the subtracted cell drifted to an empty row, go back to the first formula, add dollar signs to that reference with F4, and fill down again.
Semicolons or commas in functions
The LibreOffice help writes function arguments with semicolons, as in =RAWSUBTRACT(10;3;2). Your copy may be set to use commas instead, depending on its settings. If a function with several arguments is rejected, try the other separator, or check Tools > Options > LibreOffice Calc > Formula, where the Separators section shows which character your copy expects. On a Mac, if the Tools menu has no Options item, look in the LibreOffice menu in the menu bar instead. Plain subtraction with the minus sign isn’t affected.
Confirming the result and undoing mistakes
A quick check before you rely on a sheet saves a lot of trouble later.
- Read the formula, not just the answer. Click the result cell and look at the Input line to confirm the right cells are being subtracted, in the right order.
- Trace the inputs. With the result cell selected, choose Tools > Detective > Trace Precedents (Shift+F9). Calc draws arrows from the cells the formula uses and frames them in blue. The arrows are only on-screen markers and don’t change the sheet; open the Tools > Detective menu again to clear them when you’re done.
- Do one row by hand. Work out a single row on paper or with a calculator and compare.
- Cross-check totals. As in Priya’s sheet, the sum of the row differences should equal the difference of the column totals.
- Check the decimals. A cell formatted to show whole numbers can hide cents. Add decimal places on the Numbers tab of Format Cells if results seem a little off.
To reverse a change, press Ctrl+Z or choose Edit > Undo. Each press steps back one action, which also covers a Paste Special subtraction or a fill-down that went too far. To fix a single formula, select its cell, press F2, correct the reference or operator, and press Enter. To remove a formula entirely, select the cell and press Delete.
Questions people ask about subtracting in Calc
Is there a SUBTRACT or MINUS function in LibreOffice Calc?
No. The Mathematical functions list includes SUM, PRODUCT and QUOTIENT but nothing called SUBTRACT or MINUS. Typing one of those names returns #NAME?. Use the minus sign, or RAWSUBTRACT if you specifically need its unrounded output. Google Sheets is different here: it does have a dedicated function, covered in using MINUS in Google Sheets.
Can I subtract one column from another in a single step?
The simplest route is one formula in the first row, such as =A2-B2, dragged down with the fill handle. Calc also supports array formulas, which you confirm with Ctrl+Shift+Enter instead of Enter, but for basic row-by-row subtraction they add complexity without much benefit.
Will my subtraction formulas work if I open the file in Excel?
Formulas built from the minus sign, SUM and cell references carry over well, because both programs use the same =A2-B2 style. RAWSUBTRACT is a LibreOffice-only function, so avoid it in files you share with Excel users. If you also work in Microsoft’s spreadsheet, subtracting in Excel follows nearly identical steps.
Why does a time subtraction show a negative value or a row of hash marks?
The end time is earlier than the start time, usually because the period crosses midnight. Use =(B2<A2)+B2-A2 so Calc adds a day when needed. Hash marks can also simply mean the column is too narrow, so widen it before assuming the formula is wrong.
Does the order of operations affect subtraction?
Yes. Multiplication, division and powers are calculated before addition and subtraction, and percent comes before those. =20-4*2 gives 12, while =(20-4)*2 gives 32. When in doubt, add parentheses around the part you want done first.
Is subtraction in Calc different from Google Sheets?
The basic formula is the same in both, and so is the fill-handle technique. The differences are mostly around the edges: Sheets has a MINUS function and runs in a browser, while Calc offers RAWSUBTRACT and Paste Special operations on the desktop. The steps for the browser app are in how to subtract in Google Sheets.
Next step
Open a blank Calc sheet, type two numbers, and build =A2-B2 yourself. Then drag it down a few rows and try locking one reference with F4. Once those two moves feel natural, every other subtraction in this article is a small variation on them.