Skip to footer content
EXCEL TOOLS

How to Subtract in Excel: Every Method Explained (2026)

Written by the team at Iron Software.


Need to subtract numbers in Excel right now? Here is the short answer: click the cell where you want the result to appear, type =, click the first cell, type a minus sign (-), click the second cell, and press Enter. That is genuinely all there is to the most common case, two numbers, two cells, one formula.

But Microsoft Excel gives you far more flexibility than that single approach. Whether you need to subtract multiple cells at once, work across two columns, subtract dates, subtract time values, handle percentages, or perform calculations on an entire matrix, this guide covers every method. Build these into your Excel skills and you will be able to tackle even the most complex tasks without hesitation. *

Method 1: The Simple Subtraction Formula (Fastest)

Simple subtraction in Excel starts here, and for most everyday work, it never needs to go further.

  1. Click the result cell where you want the answer to show (e.g., C1).
  2. Type an equals sign: =
  3. Click the first cell with your starting value (e.g., A1), or type a number directly.
  4. Type a minus sign: -
  5. Click the cell with the value to subtract (e.g., B1), or type the number.
  6. Press Enter.

The following formula appears in C1: =A1-B1. Excel will display the calculated difference immediately.

How to Subtract in Excel: Every Method Explained (2026): Image 1 - A simple three-column layout, "Revenue" in A1, "Costs" in B1, and the formula =A1-B1 visible in C1

Why this works: Excel treats anything starting with = as a formula. The minus sign is the subtraction operator, just the same sign you use in everyday math.

Pro tip: You can subtract multiple numbers in one formula by chaining the minus sign. To subtract three values from a starting value, write =A1-B1-C1. You can chain as many as you need, and Excel will perform all the calculations left to right.

Note on the SUBTRACT function: Excel has no built-in SUBTRACT function. Every instance of subtraction in Excel uses the minus sign (-) directly inside a formula. This surprises many new users who expect a function the way SUM or AVERAGE work but the minus sign operator is the correct and only way to subtract in Excel. *

Method 2: Subtract an Entire Column at Once (Fill Handle)

Once you have one formula working, copying it down an entire column takes only a second using the fill handle.

  1. Enter your subtraction formula in the first cell of the column (e.g., =A1-B1 in cell C1).
  2. Click C1 to select it.

  3. Hover over the small green square at the bottom-right corner of the cell, this is the fill handle. The cursor changes to a thin crosshair +.
  4. Click and drag the fill handle downward to cover all the rows you want.
  5. Release the mouse, Excel fills every cell with an adjusted formula automatically.

How to Subtract in Excel: Every Method Explained (2026): Image 2 - The fill handle (green square) and adjusted formulas visible in each row

Excel automatically updates the cell references as it fills down. C2 will contain =A2-B2, C3 will contain =A3-B3, and so on. This is called relative referencing and it is one of the most time-saving Excel skills for anyone working with rows and columns of data.

Double-click shortcut: If your data has no empty cells or gaps in the adjacent column, you can double-click the fill handle instead of dragging. Excel will fill down automatically to match the length of the neighboring column ideal for applying a formula across many cells at once. *

Method 3: Subtract Multiple Cells Using the SUM Function

To subtract multiple cells from one starting value in a single, clean formula, use the SUM function with negative values.

The approach: pass the values you want to subtract as negative numbers inside SUM.

Formula — subtract multiple cells individually:

=SUM(A1, -B1, -C1, -D1)
=SUM(A1, -B1, -C1, -D1)
The provided C# code appears to be a fragment or possibly a formula from a spreadsheet application like Excel, rather than actual C# code. If this is intended to be a formula, it doesn't directly translate to VB.NET as it stands. However, if you meant to convert a C# code snippet that uses a similar operation, please provide the complete C# code for accurate conversion.
$vbLabelText   $csharpLabel

Formula — subtract a range from one cell (most common pattern):

=A1-SUM(B1:B5)
=A1-SUM(B1:B5)
=A1-SUM(B1:B5)
$vbLabelText   $csharpLabel

This second version is especially useful when you have a budget or total in one cell and a list of expenses or deductions spread across many cells in a range.

How to Subtract in Excel: Every Method Explained (2026): Image 3 - A budget tracker with "Starting Budget" in A1, expenses listed, and showing the remaining balance

When to use this: Any time you need to subtract more than two or three values, this pattern is cleaner and far easier to audit than chaining multiple minus signs across multiple columns. It also makes it easy to extend the range later without rewriting the formula. *

Method 4: Subtract Two Columns (Row by Row)

Subtracting two columns is one of the most common tasks in Excel, for instance, subtracting a "Cost" column from a "Revenue" column to determine profit on each row.

  1. In the result cell (e.g., C1), enter =A1-B1.
  2. Press Enter.
  3. Click back on C1, then use the fill handle to drag the formula down through all rows.

Excel subtracts each pair of cells across the two columns automatically, A1−B1, A2−B2, A3−B3, and so on all the way down.

This is the standard approach for working with rows and columns of tabular data, and it scales to any number of rows without changing the formula structure. *

Method 5: Subtract Using an Array Formula (Subtract Multiple Columns at Once)

An array formula lets you subtract across an entire range and return multiple results or collapse them into a single answer without manually filling down row by row. This is the approach to reach for when you need to subtract values from multiple columns simultaneously, or when performing matrix subtraction.

Single Array Formula — Sum All Differences Between Two Columns

To subtract all values in column B from column A and return the total difference in one result cell, use this single array formula:

=SUM(A1:A10-B1:B10)
=SUM(A1:A10-B1:B10)
The provided code appears to be an Excel formula rather than C# code. If you have C# code that you would like converted to VB.NET, please provide that code for conversion.
$vbLabelText   $csharpLabel

In older versions of Excel (prior to Microsoft 365 / Excel 2019), confirm this as an array formula by pressing Ctrl+Shift+Enter instead of just Enter. Excel will display it with curly braces: {=SUM(A1:A10-B1:B10)}. In Microsoft 365, pressing Enter alone is sufficient, dynamic arrays handle it automatically.

How to Subtract in Excel: Every Method Explained (2026): Image 4 - The formula =SUM(A1:A10-B1:B10) in a result cell

Matrix Subtraction Formula — Subtract One Matrix from Another

If you have two equally sized blocks of data and need to subtract one matrix from another, Excel can handle this across all rows and columns at once.

Example: Values in A1:C3 (first matrix) and E1:G3 (second matrix). To display the matrix subtraction result in I1:K3:

  1. Select the output range I1:K3 (same size as your data blocks).

    1. Type the following formula:
    =A1:C3-E1:G3
    =A1:C3-E1:G3
    The provided C# code appears to be a fragment of a formula or expression rather than valid C# code. It seems to resemble a spreadsheet formula rather than a programming construct. If you intended to provide a different piece of C# code, please clarify or provide the correct code for conversion.
    $vbLabelText   $csharpLabel
  2. In Excel 365, press Enter, the results spill automatically across all output cells.
  3. In older Excel, press Ctrl+Shift+Enter to confirm the array formula across the selected range.

Array formulas operate on every pair of corresponding cells in the range simultaneously. This is significantly more efficient than writing individual formulas for each cell when you need to subtract one matrix from another or subtract values from multiple columns in bulk. *

Method 6: Paste Special — Subtract the Same Number from Many Cells

This method is underused but extremely practical. It lets you subtract the same number from a whole range of cells in place, overwriting the original values without adding any formula columns to your data.

Example use case: You need to reduce 50 prices by $10 each, and you want the prices updated directly in the original cells.

Steps:

  1. Type the number you want to subtract (e.g., 10) in any empty cell.
  2. Right-click that cell and choose Copy (or press Ctrl+C).

  3. Select the range of cells you want to subtract from (e.g., A1:A50).
  4. Right-click the selected range and choose Paste Special (or press Ctrl+Alt+V).

  5. In the Paste Special dialog, select Values under "Paste" and Subtract under "Operation."

  6. Click OK.

Excel will subtract the copied number from every selected cell and overwrite the original values directly in place.

Important: This method permanently changes the cell values. If you might need to reverse it, keep a backup copy of your original data first, or use Ctrl+Z immediately if you change your mind. *

Method 7: Right-Click Context Menu (Paste Special Shortcut)

It is worth calling out that Paste Special is always one right-click away in Microsoft Excel, many users do not realize the context menu gives direct access to this feature without navigating any ribbon menus.

After copying your value:

  • Right-click the destination range → Paste Special → set Operation to SubtractOK.

This workflow lives entirely in the mouse, no keyboard shortcuts required which makes it the most accessible approach if you prefer point-and-click navigation over keyboard commands. *

Method 8: Subtract Dates to Find the Difference

Excel stores dates as serial numbers internally, which means you can subtract dates the same way you subtract any other numbers to determine the difference between them.

Subtract two dates to get the number of days between them:

=B1-A1
=B1-A1
$vbLabelText   $csharpLabel

Where A1 is the start date and B1 is the end date. The answer is the number of days separating them.

Fix the cell format if the result displays as a date: After entering the formula, the result cell might display something like "1/14/1900" instead of a number. This happens because Excel automatically applied a date cell format to the result. To fix it:

  1. Right-click the result cell → Format Cells.
  2. Under Number, choose Number or General.

  3. Click OK.

The cell will now display the correct integer difference between the two dates. *

Method 9: Subtract Time Values (and Display Hours Correctly)

Subtracting time values works the same way as subtracting dates, enter a plain subtraction formula and Excel handles the math. The key is applying the right cell format so the result displays hours correctly.

Basic time subtraction:

=B1-A1
=B1-A1
$vbLabelText   $csharpLabel

Where A1 is the start time and B1 is the end time.

Display hours correctly for durations under 24 hours: Right-click the result cell → Format Cells → Custom → type h:mm → OK.

Display hours correctly for durations over 24 hours: Use [h]:mm as the custom format. The square brackets tell Excel not to roll the hours over at 24, so a 30-hour duration displays as 30:00 instead of 6:00.

Subtracting time values across midnight: If a shift starts at 11:00 PM and ends at 6:00 AM, a simple =B1-A1 produces a negative result. Fix it with:

=MOD(B1-A1, 1)
=MOD(B1-A1, 1)
`=MOD(B1-A1, 1)`
$vbLabelText   $csharpLabel

The MOD function wraps the calculation around midnight and always returns a positive elapsed time. *

Method 10: Subtract with Absolute Cell References (Lock One Cell)

Sometimes you want to subtract the same fixed cell from an entire column of values, for instance, subtracting a tax rate or a regional base cost stored in one reference cell from every row of a dataset.

If you use a standard formula like =A1-B1 and drag it down with the fill handle, Excel updates both cell references: B1 becomes B2, B3, and so on. That is not what you want when B1 contains the fixed value for all rows.

The fix: Add dollar signs to lock the reference. This is called an absolute reference.

=A1-$B$1
=A1-$B$1
The provided code appears to be an Excel formula rather than C# code. If you have C# code that needs conversion to VB.NET, please provide it, and I'll be happy to assist!
$vbLabelText   $csharpLabel

Now when you drag the formula down, A1 updates to A2, A3, etc., but $B$1 stays locked on B1 for every row. Subtracting from other cells in column A will always use the same number from B1.

Keyboard shortcut to toggle between reference types: Click inside any cell reference in your formula and press F4. Excel cycles through all four options: relative (A1) → absolute ($A$1) → row-locked (A$1) → column-locked ($A1). Press F4 repeatedly until you reach the version you need. *

Method 11: Subtract Percentages

Subtracting percentages in Excel requires understanding how Excel stores them internally. Excel holds all percentage values as decimals so 20% is stored as 0.2, not 20. This can produce unexpected results in calculated cells if you are not aware of it.

To subtract a percentage stored in another cell:

=A1-B1
=A1-B1
$vbLabelText   $csharpLabel

If A1 contains 500 and B1 contains 20% (stored as 0.2), this formula gives 499.8, it subtracts 0.2, not 20. That is almost certainly not the intended result.

To subtract a percentage of the original value (the most common real-world use):

=A1-(A1*B1)
=A1-(A1*B1)
$vbLabelText   $csharpLabel

Or equivalently:

=A1*(1-B1)
=A1*(1-B1)
=A1 * (1 - B1)
$vbLabelText   $csharpLabel

If A1 is 500 and B1 is 20%, this correctly calculates 500 − 100 = 400.

When subtracting a hardcoded percentage:

=A1-(A1*20%)
=A1-(A1*20%)
=A1 - (A1 * 0.2)
$vbLabelText   $csharpLabel

This removes the need for a separate percentage cell and works identically. *

Method 12: VBA Macro for Automated Subtraction

If you find yourself repeating the same subtraction operation on Excel data week after week, a simple VBA macro can automate the entire process and run it on demand.

Note: You do not need programming experience to record a basic macro. The built-in macro recorder in Microsoft Excel captures every action you take and replays it instantly.

To record a subtraction macro:

  1. Go to ViewMacrosRecord Macro.

  2. Give it a name (e.g., SubtractCosts) and assign an optional shortcut key.
  3. Click OK, recording starts.
  4. Perform your subtraction steps normally (enter your formula, drag the fill handle, press Enter, etc.).
  5. Go to ViewMacrosStop Recording.

Run it anytime via View → Macros → View Macros → Run, or use the shortcut key you assigned.

For users who want to write VBA directly, here is a simple example that loops through rows, subtracts column B from column A, and writes each result to column C:

Sub SubtractColumns()
    Dim i As Integer
    For i = 1 To 10
        Cells(i, 3).Value = Cells(i, 1).Value - Cells(i, 2).Value
    Next i
End Sub
Sub SubtractColumns()
    Dim i As Integer
    For i = 1 To 10
        Cells(i, 3).Value = Cells(i, 1).Value - Cells(i, 2).Value
    Next i
End Sub
Sub SubtractColumns()
    Dim i As Integer
    For i = 1 To 10
        Cells(i, 3).Value = Cells(i, 1).Value - Cells(i, 2).Value
    Next i
End Sub
$vbLabelText   $csharpLabel

Open the VBA editor with Alt+F11, paste this into a module under your workbook, and run it with F5. *

Common Issues and Troubleshooting

Even a simple subtraction formula can misbehave with real-world data. Here are the most common problems and how to fix them.


Problem: The result shows #VALUE!

Cause: One or more of the cells you are subtracting contains a text string rather than a number. This frequently happens when data is imported from another system, values look like numbers but Excel stores them as text, so it cannot perform calculations on them.

Fix: Select the problem cells, look for the small green triangle in the upper-left corner, click the warning icon, and choose Convert to Number. Alternatively, force the conversion inside your formula: =VALUE(A1)-VALUE(B1). *

Problem: The result cell displays a date instead of a number

Cause: Excel automatically applied a date cell format to the result (common when subtracting date values or when the cell format was set to Date beforehand).

Fix: Right-click the result cell → Format CellsNumberGeneral or NumberOK. *

Problem: The formula displays as a text string (you can see the formula text, not the answer)

Cause: The cell was formatted as Text before you entered the formula, so Excel stored it as a literal string rather than evaluating it.

Fix: Select the cell, go to HomeNumber dropdown → change the cell format from "Text" to "General." Then press F2 to edit and Enter to re-evaluate. Excel will now display the calculated result. *

Problem: Negative numbers appear when positive values expected

Cause: The subtraction order is reversed. =B1-A1 gives the opposite sign from =A1-B1. This is one of the most common mistakes when setting up formulas quickly.

Fix: Swap the cell references in your formula. If you consistently want a positive answer regardless of which value is larger, wrap the formula in ABS(): =ABS(A1-B1). *

Problem: The fill handle copies values instead of adjusting cell references

Cause: You may have used absolute references ($A$1) where you intended relative references, or the source cell was formatted as Text before the formula was entered.

Fix: Click into the formula, place the cursor inside the reference, and press F4 repeatedly until the dollar signs are removed. Then drag the fill handle again. *

Problem: Empty cells in the range are causing errors or zeros

Cause: When the formula references empty cells in your data, SUM treats them as zero (generally fine), but a direct formula like =A1-B1 where B1 is empty will return the value in A1 unchanged, which can look wrong in context.

Fix: Use IFERROR to handle empty cells gracefully:

=IFERROR(A1-B1, 0)
=IFERROR(A1-B1, 0)
The provided code snippet appears to be an Excel formula rather than C# code. If you have a C# code snippet that you would like to convert to VB.NET, please provide it, and I'll be happy to assist you with the conversion.
$vbLabelText   $csharpLabel

Or use IF to check explicitly before subtracting:

=IF(B1="", A1, A1-B1)
```* * *

### Problem: Subtracting percentages gives unexpected results

**Cause:** Excel stores percentages as decimals. Subtracting A1 - 20% subtracts 0.2 from A1's value, not 20.

**Fix:** Use =A1*(1-B1) to subtract a percentage of the original value. Use =A1-20 to subtract the literal number 20 regardless of how values are formatted in other cells.* * *

## Edge Cases the Other Articles Miss

**Subtracting across worksheets:** You can subtract values from different sheets in one formula. The syntax is =Sheet1!A1-Sheet2!A1. While building your formula, simply click the cell on the other sheet and Excel writes the full reference automatically.

**Subtracting with IFERROR for bulletproof formulas:** Whenever there is any chance a cell might be empty or return an error, wrap your formula to prevent the error from propagating to other cells that depend on this result:

```cs
=IFERROR(A1-B1, 0)
=IF(B1="", A1, A1-B1)
```* * *

### Problem: Subtracting percentages gives unexpected results

**Cause:** Excel stores percentages as decimals. Subtracting A1 - 20% subtracts 0.2 from A1's value, not 20.

**Fix:** Use =A1*(1-B1) to subtract a percentage of the original value. Use =A1-20 to subtract the literal number 20 regardless of how values are formatted in other cells.* * *

## Edge Cases the Other Articles Miss

**Subtracting across worksheets:** You can subtract values from different sheets in one formula. The syntax is =Sheet1!A1-Sheet2!A1. While building your formula, simply click the cell on the other sheet and Excel writes the full reference automatically.

**Subtracting with IFERROR for bulletproof formulas:** Whenever there is any chance a cell might be empty or return an error, wrap your formula to prevent the error from propagating to other cells that depend on this result:

```cs
=IFERROR(A1-B1, 0)
The provided code snippets appear to be Excel formulas rather than C# code. However, if you intended to convert the logic of these Excel formulas into VB.NET code, here's how you might represent similar logic in VB.NET:

net

In this VB.NET code:
- `A1` and `B1` would be variables representing the values from cells A1 and B1.
- The `If` statement is used to mimic Excel's `IF` function.
- The `Try...Catch` block is used to handle errors similarly to Excel's `IFERROR` function.
$vbLabelText   $csharpLabel

Subtracting time values across midnight: For shift tracking that crosses midnight (11:00 PM start, 6:00 AM end), use =MOD(B1-A1, 1) to always return a positive elapsed time.

Subtracting in filtered data (visible rows only): Standard subtraction formulas include hidden rows in their results. To work with only the visible cells after filtering, use SUBTOTAL to aggregate the visible data first, or copy the filtered range to a new location before performing calculations.

Subtracting multiple columns in bulk without an array formula: Instead of writing =A1-B1-C1-D1-E1-F1, use =A1-SUM(B1:F1). It is easier to extend, easier to read, and less prone to errors when adding or removing columns. *

For Developers: Subtract in Excel with IronXL (C#)

If you are building a .NET application that reads, modifies, or generates Excel files, a reporting pipeline, a financial tool, a document automation system, performing calculations directly in C# gives you far more control than relying on a user to open Microsoft Excel and run formulas manually.

IronXL is a .NET library that lets you read and write Excel files without requiring Excel to be installed on the server. The following example subtracts values from two columns and writes the results to a third, the programmatic equivalent of the two-column subtraction method described above:

using IronXL;
// Load an existing workbook (or create one fresh with WorkBook.Create())
WorkBook workbook = WorkBook.Load("financials.xlsx");
WorkSheet sheet = workbook.DefaultWorkSheet;
// Loop through rows: subtract Column B from Column A, write each result to Column C
for (int row = 1; row <= 10; row++)
{
    double valueA = sheet[$"A{row}"].DoubleValue;
    double valueB = sheet[$"B{row}"].DoubleValue;
    sheet[$"C{row}"].Value = valueA - valueB;
}
workbook.SaveAs("financials_updated.xlsx");
using IronXL;
// Load an existing workbook (or create one fresh with WorkBook.Create())
WorkBook workbook = WorkBook.Load("financials.xlsx");
WorkSheet sheet = workbook.DefaultWorkSheet;
// Loop through rows: subtract Column B from Column A, write each result to Column C
for (int row = 1; row <= 10; row++)
{
    double valueA = sheet[$"A{row}"].DoubleValue;
    double valueB = sheet[$"B{row}"].DoubleValue;
    sheet[$"C{row}"].Value = valueA - valueB;
}
workbook.SaveAs("financials_updated.xlsx");
Imports IronXL

' Load an existing workbook (or create one fresh with WorkBook.Create())
Dim workbook As WorkBook = WorkBook.Load("financials.xlsx")
Dim sheet As WorkSheet = workbook.DefaultWorkSheet

' Loop through rows: subtract Column B from Column A, write each result to Column C
For row As Integer = 1 To 10
    Dim valueA As Double = sheet($"A{row}").DoubleValue
    Dim valueB As Double = sheet($"B{row}").DoubleValue
    sheet($"C{row}").Value = valueA - valueB
Next

workbook.SaveAs("financials_updated.xlsx")
$vbLabelText   $csharpLabel

No Excel installation required, no COM interop issues, and it runs on Windows, Linux, and macOS. IronXL supports full formula evaluation, cell formatting, range operations, and data reading across rows and columns of any size making it a natural fit for automated batch workflows where opening a spreadsheet manually is not practical. *

Quick Reference: Which Method to Use

| Situation | Best Method | | --- | --- | | Subtract two numbers or two cells once | Simple formula: =A1-B1 | | Subtract across an entire column | Formula + fill handle drag | | Subtract multiple cells from one total | =A1-SUM(B1:B5) | | Subtract multiple columns into one result | =A1-SUM(B1:F1) | | Subtract the same number from many cells | Paste Special → Subtract | | Subtract a fixed reference cell from all rows | Absolute reference: =A1-$B$1 | | Subtract one matrix from another | Array formula: =A1:C3-E1:G3 | | Subtract dates — find difference in days | =B1-A1 + General cell format | | Subtract time values, display hours correctly | =B1-A1 + [h]:mm cell format |

| Subtract percentages of a value | =A1*(1-B1) | | Handle empty cells or errors gracefully | =IFERROR(A1-B1, 0) | | Repeat the same subtraction operation weekly | Record a VBA Macro | | Automated or server-side Excel subtraction | IronXL (.NET) |


Final Thoughts

Excel subtraction is one of those skills that looks trivially simple at first and for the basic case, it truly is. But working with real-world data means running into dates, time values, percentages, empty cells, text strings, filtered rows, and multi-column or matrix ranges. Knowing which tool to reach for in each situation is what separates someone who can perform basic calculations in Excel from someone who can confidently handle complex tasks without getting tripped up.

For most work, =A1-B1 and the fill handle will take you very far. The SUM-based approach handles multiple cells cleanly. Absolute references lock in fixed values. Array formulas and the matrix subtraction formula handle scenarios where you need to subtract across entire ranges at once. And the troubleshooting section covers the situations most likely to catch you off guard when working with imported or inconsistent data.

These are core Excel skills and now you have all of them in one place.

Jordi Bardia
Software Engineer
Jordi is most proficient in Python, C# and C++, when he isn’t leveraging his skills at Iron Software; he’s game programming. Sharing responsibilities for product testing, product development and research, Jordi adds immense value to continual product improvement. The varied experience keeps him challenged and engaged, and he ...
Read More

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me