Subtraction is one of the four basic operations of math. You can use subtraction on its own, or in combination with other functions to create complex formulas. There's no particular function for subtracting in Google Sheets, and to subtract two numbers, you can simply use the minus (-) sign.
Aside from subtracting numbers from one another, you can also subtract the numbers in cells by referring to them in the formula bar. Moreover, you can subtract a bunch of numbers sequentially and even subtract matrices from one another. You can accomplish all these with the minimalist minus sign (-).
How to Subtract Numbers in Google Sheets
Since there's no subtract function in Google Sheets, you can subtract numbers in Sheets in the same fashion as you would on paper. Except that this time, you won't actually have to calculate it yourself, as Sheets will take care of that. Let's start off by subtracting two numbers.
- Select the cell that you want to show the subtraction result in.
- Go to the formula bar and type in an equal (=) sign. This will initiate your formula.
- Enter the number that you want to subtract from, followed by a minus sign (-) and then the number that you want to subtract. If you're looking to subtract 140 from 256, the formula will look like below:
=256-140
- Press Enter. The result will show in the cell.
Related: How to Subtract in Excel
How to Subtract Cells in Google Sheets
Rather than manually entering numbers in your subtraction formula, you can refer to the cells that contain the numbers. In this sample spreadsheet, we have the number of initial volunteers for an experiment and the number of volunteers who resigned. The goal is to calculate the number of current volunteers.
- Select the cell where you want to show the calculation results. That'll be cell B3 in this example.
- Go to the formula bar and enter the formula below:
=B1-B2
This will subtract the number in B2 from the number in B1 and display the results in B3. - Press Enter. Google Sheets will now display the number of current volunteers in cell B3.
How to Subtract Multiple Cells in Google Sheets
You can also subtract multiple numbers in a single formula. There are many ways you could do this, but we're going to take a look at two of the simplest methods.
As an extension of the previous example, we have a spreadsheet with the number of initial volunteers, along with volunteers that have resigned each month. The goal here is to calculate the number of current volunteers, by subtracting the resigned ones from the initial number.
Sequential Subtraction
- Select the cell where you want to show the final result. This will be cell B8 for the current example.
- In the formula bar, enter the formula below:
=B1-B2-B3-B4-B5-B6-B7
This formula will subtract B2 from B1, and then subtract B3 from the result of the previous subtraction, and will keep going until B7 is subtracted from the result of all previous subtractions. - Press Enter. You can now see the number of current volunteers.
Subtracting With the SUM Function
The SUM function is a handy Google Sheets function that sums cells together. Using the SUM function, you can sum all the cells and then subtract the total number.
The SUM function enables you to achieve the results from the previous example with ease and without having to refer to the cells one by one.
- Select the cell where you want to show the subtraction result. As before, we're going to use cell B8.
- In the formula bar, enter the formula below:
=B1-SUM(B2:B7)
This formula will add all the resigned volunteers together with the SUM function, and then it will subtract the total of resigned volunteers from the initial volunteers. The resulting number will be the number of current volunteers. - Press Enter. Google Sheets will now calculate and display the number of current volunteers.
How to Subtract Matrices in Google Sheets
A matrix is essentially an array of numbers put in a table. You can apply basic mathematical operations on matrices in Google Sheets, and you can easily subtract one from another. Keep in mind that to subtract matrices, both matrices must have the same structure.
That means if your first matrix is a 3×3, then the second matrix and the third matrix (where you will display the subtraction results) should be 3×3 as well.
Related: How to Check if Two Matrices Are Identical With Programming
Since matrices are arrays, you'll need to write an array formula to be able to work on them. An array is a structure that houses multiple values, and an array formula signals to Google Sheets to treat these values as an array, and not single values. Though the name of it might seem a bit daunting, in this case, the array formula is simple.
In this example, we have three 3×3 matrices. The goal is to subtract matrix 2 from matrix 1 and display the results in matrix 3.
- Select the first cell in the matrix that you want to show the subtraction results. In this example, matrix 3 starts from E5, so we select E5.
- Go to the formula bar. There are two paths you could take here on.
- In the formula bar, enter the formula below and press Ctrl + Shift + Enter:
=(A2:C4)-(A7:C9)
This formula selects matrix 2 (A7:C9) and then subtracts it from matrix 1 (A2:C4). Pressing Ctrl + Shift + Enter rather than Enter alone will have Google Sheets know that it's dealing with an array formula. Sheets will add the ArrayFormula function to your formula and display the results. - In the formula bar, enter the formula below and press Enter:
=ArrayFormula((A2:C4)-(A7:C9))
The subtraction formula is put inside the ArrayFormula function. This will turn the formula into an array formula, and Google Sheets will treat the numbers as arrays. Since you've already used the ArrayFormula yourself, there's no need to use the Ctrl + Shift + Enter combo.
- In the formula bar, enter the formula below and press Ctrl + Shift + Enter:
- You can now see the subtraction results in matrix 3.
Subtraction Made Easy With Google Sheets
Subtraction is one of the four basic math operations, and you can subtract numbers, cells, and even matrices using Google Sheets. Though subtraction remains simple at its core, you can still combine it with other Sheets functions to create complex formulas that make your calculations much easier.
Google Sheets is a bliss and has the potential to make life much easier for everyone who deals with numbers. The good thing about Sheets is that just when you think it can't make calculations any easier, it takes you by surprise and shows you that it can make life even easier.