To square a number in excel

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 More…Less

You can square a number in Excel with the power function, which is represented by the carat ^ symbol. Use the formula =N^2, in which N is either a number or the value of the cell you want to square. This formula can be used multiple times throughout a worksheet.

Square a number in its own cell

Follow these steps:

  1. Click inside a cell on your worksheet.

  2. Type =N^2 into the cell, where N is the number you want to square. For example, to insert the square of 5 into cell A1, type =5^2 into the cell.
     

    The formula is in the cell.

  3. Press Enter to see the result.

    Tip: You can also click into another cell to see the squared result.

    The squared result is in the cell.

Square a number in a different cell

Follow these steps:

  1. Click inside a cell and type the number that you want to square.

  2. Select another empty cell in the worksheet.

  3. Type =N^2 into the empty cell, in which N is a cell reference that contains the numeric value you want to square. For example, to display the square of the value in cell A1 into cell B1, type =A1^2 into cell B1.

  4. Press Enter to see the result.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Need more help?

Thanks to spreadsheet software like Excel, it has become easier than ever to find squares of thousands of numbers at a time, even if some of them are quite large.

With Excel there are two ways in which you can square a number:

  1. Using a Formula
  2. Using a Function

Both ways are quick and easy, as you will soon see.

In this tutorial, we are going to show you how to use the above two ways to find the square of a number in Excel.

Two Quick Ways to Square a Number in Excel

To understand how to quickly square numbers in Excel, we are going to use the following dataset:

Dataset to square numbers in Excel

In this dataset, we want to find the square of each value of column A and display the result in column B.

Let us see how to accomplish this in Excel.

Using a Formula to Square a Number

Squaring a number simply means multiplying a number by itself, or raising it to the power of 2.

So, to square the number in the cell reference A2, you can write the formula in two different ways:

  • Using the multiplication operator to multiply it by itself
  • Using the caret operator to raise the number to the power of 2

Using the Multiplication Operator

In Excel, you can multiply numbers using the multiplication operator, also known as an asterisk symbol (‘*’).

So to multiply the value in cell A2 with itself, you can use the formula:

=A2 * A2

Thus, here are the steps you can follow to find the square of each number in our given dataset:

  1. Select the cell where you want the first result to appear (cell B2).
  2. Type the formula: =A2*A2.
  3. Press the return key.
  4. The square of the value in A2 should now be displayed as the result in cell B2.Multiplication using asterisk sign
  5. Drag down the fill handle (the small square at the bottom right corner of cell B2) till you reach the last row of your dataset.Result of multiplication using asterisk
  6. Each cell in column B should now contain the square of the corresponding value in column A.Copy the formula to the entire column

Using the Caret Operator

In Excel, you can raise one number to the power of another using the exponent operator, also known as a caret symbol (‘^’).

So to square the value in cell A2 you need to raise it to the power of 2. For this, you can use the formula:

=A2 ^ 2

Thus, here are the steps you can follow to find the square of each number in our given dataset:

  1. Select the cell where you want the first result to appear (cell B2).
  2. Type the formula: =A2^2.
  3. Press the return key.
  4. The square of the value in A2 should now be displayed as the result in cell B2.Formula to square using caret
  5. Drag down the fill handle (the small square at the bottom right corner of cell B2) till you reach the last row of your dataset.
  6. Each cell in column B should now contain the square of the corresponding value in column A.Copy the formula to the entire column

Using a Function to Square a Number

Excel provides a useful function to raise a number to a certain power.

The POWER function works like an exponent in a standard math equation and raises one number to the power of another.

The syntax for the POWER function is as follows:

=POWER (number, power)

Here,

  • number is the number that you want to raise to an exponent.
  • power is the exponent you want to raise the number to the power of.

So if you want to use the POWER function to find the square of a number, say the value in cell A2, you need to raise it to the power of 2 as follows:

=POWER(A2,2)

Thus, here are the steps you can follow to find the square of each number in our given dataset:

  1. Select the cell where you want the first result to appear (cell B2).
  2. Type the formula: =POWER(A2,2).
  3. Press the return key.
  4. The square of the value in A2 should now be displayed as the result in cell B2.POWER formula to find the square of a number
  5. Drag down the fill handle (the small square at the bottom right corner of cell B2) till you reach the last row of your dataset.
  6. Each cell in column B should now contain the square of the corresponding value in column A.Copy the formula to the entire column

Note: The POWER function is located along with the Math & Trig functions in the Formulas tab (under Function Library). If you’re in the Insert Function dialog box, you can find it under the Select a Category drop-down list.

Click on the POWER formula option

In this tutorial, we showed you three very easy and quick ways to square a number in Excel.

The first two methods use a formula, while the third method uses the POWER function. We hope you found this tutorial simple and easy to follow.

Other Excel tutorials you may also like:

  • How to Insert Square Root Symbol in Excel
  • How to Subtract Multiple Cells from One Cell in Excel
  • How to Calculate Standard Error In Excel
  • How to Use e in Excel | Euler Number in Excel
  • How‌ ‌to‌ ‌Use‌ ‌Pi‌ ‌(π) in‌ ‌Excel‌ ‌
  • How to Calculate Antilog in Excel
  • How to Find Range in Excel
  • How to Calculate Nth Root in Excel?

The aim is simple. Squaring a number, a number raised to the power 2, the number multiplied by itself; it’s all the same thing, you know the drill. If this is giving you unfond memories of your childhood math classes, it’s a good thing you’re here because we aren’t going to math-splain you.

This tutorial is about squaring a number in Excel, and we will break down all the methods mentioned above. Throughout this tutorial, for our examples, we will square the numbers in one column and try to print the results next to them using different easy peasy ways.

Let’s start diving into the easy peasy ways which we will split into 2 sections; in the first section, we will square numbers using formulas and in the second section, we will use functions.

How to Square a Number in Excel

Squaring Numbers Using Formulas

In this section, we will use two formulas to square numbers:

  • Formula using multiplication operator
  • Formula using caret operator

Let’s see them one by one.

Multiplication Operator Based Formula For Squaring Numbers

By multiplication operator, we are referring to the asterisk ( * ) symbol. A squared number is basically the number multiplied by itself so we will do just that on our worksheet in the form of a formula. Let’s see this practically.

We will use the following formula in our example:

=B3*B3 //where B3 contains the number to be squared

This reads as B3 multiplied by B3. The value in cell B3 is 2 and so the calculation goes as 2 multiplied by 2. Here is the outcome:

Square-a-number-in-excel-multiplication-operator-01

Also, instead of making use of the cell references, you can apply the formula directly as:

=2*2 //returns 4

Wasn’t that easy breezy? It’s nice to have Excel do all the work for you. Let’s keep flowing with the easy breeze into the next formula.

Caret Operator Based Formula For Squaring Numbers

By caret operator, we are referring to the » ^ » symbol. Caret Operator is also known as Exponent operator. Does anyone remember five raised to the power two?

(Hint: Math classes again)

The caret is essentially saying ‘raised to the power’. Hence, 5 raised to the power 2 becomes 5^2, squaring the number 5. Let’s see how it helps us in Excel.

Referring to our example, the formula using the caret symbol to square a number will be:

=B3^2 //where B3 contains the number to be squared

This reads as B3 raised to the power 2. The value in cell B3 is 2 and so the calculation goes as 2 raised to the power 2 with «4» as the squared result. Applying this formula to square numbers will give us the following results:

Square-a-number-in-excel-caret-operator-02

Also, instead of relying on the cell references, you can apply the formula directly as:

=2^2 //returns 4

Just now, we used a formula to raise the power of a number. We can apply the same principle using a function, which brings us to our next section where we square numbers using functions.

Recommended Reading: Calculate Square Root of a Number

Squaring Numbers Using Excel Functions

This section covers the use of functions to square numbers. The functions we will use are:

  • The POWER function
  • The PRODUCT function
  • The SUMPRODUCT function

Using POWER Function

The POWER function works like a caret operator, raising the number to a power. The syntax of POWER function is very simple it takes two arguments: number and power.

For the purpose of this article, we are interested in squaring the number so we are working only with raising the numbers to the power «2». The POWER function can easily do that for us.

This is how we will use the POWER function for our example:

=POWER(B4, 2) //where B4 contains the number to be squared

The value in cell B4 is «10». The «2» in the second argument here is the power by which the number in cell B4 («10») is to be raised. The result of 10 raised to the power 2 is 100 which we have in our results:

Square-a-number-in-excel-by-power-function-03

For instances where you wish to skip the cell reference in the function, you can apply the function directly as:

=POWER(10,2) //returns 100

Using PRODUCT Function

The PRODUCT function will multiply all the numbers given as arguments. Similar to how we used a multiplication formula to multiply the number with itself, we can use the PRODUCT function for the same calculation, separating the numbers by commas instead of asterisks (*).

Carrying down our base example, for squaring a number, we will need to supply the number twice in the formula and that should do it:

=PRODUCT(B4, B4) //where B4 contains the number to be squared

Cell B4 contains the number «10». Since the PRODUCT function multiplies all the supplied numbers, for squaring the number 10, we only need to supply it twice to the formula. 10 multiplied by 10 gives us 100 which we also have here in the results:

Square-a-number-in-excel-by-product-function-04

For instances where you wish to skip the cell reference in the function, you can apply the function directly as

=PRODUCT(10,10) //returns 100

Similar to the PRODUCT function, we can use the SUMPRODUCT function for squaring numbers. Let’s see ahead.

Using SUMPRODUCT Function

An extension of the PRODUCT function, the SUMPRODUCT function multiplies the supplied number groups and then adds the outcomes of the multiplied groups for the final result. It works like this:

For instance, if we have a SUMPRODUCT function as:

=SUMPRODUCT(A1:A3,B1:B3)

Then the result will be calculated as  –

The SUMPRODUCT function will multiply each element from both the cell ranges and then added them to one another to return the final result.

Mathematically this is equivalent to writing –

(A1*B1) + (A2*B2) + (A3*B3)

Now, lets jump back to our case –

For squaring a number we need to multiply the number by itself. Therefore, we only need to pass one group of numbers to the SUMPRODUCT function. SUMPRODUCT will multiply that for us and hand us the result. We are to use it just like the PRODUCT function.

So if we are to use it exactly like the PRODUCT function, why add the «SUM» prefix? Well, since we are exploring options and this is viable, we have to have the talk about it. Let’s put it to use with our example.

=SUMPRODUCT(B4,B4) //where B4 contains the number to be squared

Cell B4 contains the number «10». As the SUMPRODUCT function multiplies all the supplied number groups and then adds the result of those multiplied groups, we will only provide one number group i.e. «B4, B4» which will be «10, 10» since that is what we require for squaring the number.

SUMPRODUCT will multiply 10 by 10. The result will be 100. Since there is no other number group to multiply, the final outcome of SUMPRODUCT is 100.

Square-a-number-in-excel-by-SumProduct-function-05

For instances where you wish to skip the cell reference in the function, you can apply the function directly as:

=SUMPRODUCT(10,10) //returns 100

This ends our tutorial, fair and square. Thanks to the power of Excel, we have many options for the simplest of calculations. There’s so much more to explore and this is just a wodge of Excel. We’ll come up with another wodge soon, be sure to have your part!

Home / Excel Formulas / How to Square a Number in Excel

If you want to square a number in Excel, you can use two easy ways to follow methods, and both methods work in the same way. You need to specify the number for which you want to calculate the square and specify 2 as you want to calculate the square.

Ahead in this tutorial, we will use an example to understand it.

Using POWER to Calculate Square

  1. Enter the POWER function in the cell.
  2. Refer to the cell where you have the number for which you need to calculate the square.
  3. In the second argument, enter 2 as you need to raise the power to 2.
  4. Close the function and hit enter.

The moment you need to hit enter the function returns the square as you can see in the above example.

Using the Power Operator (^)

In the same way, you also use the power operator (^) to get the square of a number in Excel. And in this method, you don’t need to use any function. Here’s the method:

  1. Refer to the cell where you have a number for which you want to calculate the square.
  2. Enter a ^ using the keyboard (you can find it on the number key 6).
  3. Type 2, which tells Excel to raise its power to 2.
  4. Hit enter to get the result.

As I said, both functions work in the same way and are quite easy to use. But you can choose one according to your need.

More Formulas

  • Calculate Compound Interest in Excel
  • Calculate Cube Root in Excel
  • Calculate Percentage Variance (Difference)
  • Calculate Simple Interest in Excel
  • Calculate SQUARE ROOT in Excel
  • Calculate the Weighted Average in Excel
  • Does Not Equal Operator in Excel
  • Round a Number to Nearest 1000, 100, and 10
  • Round to Nearest .5, 5. 50 (Down-Up) in Excel
  • Round a Number to Nearest 1000 in Excel
  • Add-Subtract Percentage from a Number
  • Average But Ignore Errors
  • Average Number but Exclude Zeros
  • Average Only Non-Blank Cells
  • Calculate the Average of the Percentage Values
  • Calculate the Average of the Time Values
  • Calculate the Cumulative Sum of Values
  • Round Percentage Values

⇠ Back to 100+ Excel Formulas List (Basic + Advanced)

Are you looking for a way to square a number?

If you work in a field like carpentry, engineering, architecture, or technology, you probably are!

Squaring a number is the mathematical operation of multiplying a number by itself. As an example, a square-sized bedroom measuring 10 feet wide and 10 feet long could be expressed as 100 square feet by multiplying 10 by 10.

This post explores all the different ways to square a number in Microsoft Excel.

Square a Number with the Multiplication Operator

The most straightforward way to square a number is to multiply it by itself using the traditional multiplication operator.

= B3 * B3

The above formula will multiply the number in cell B3 by itself. The asterisk (*) is the operator for multiplication.

You’ve just squared your number from cell B3!

To apply your formula to your other numbers, hover over the lower-right corner of the formula’s cell until your cursor turns to a plus (+), then double-click.

Square a Number with the Carat Operator

The carat operator (^) in Excel is designed for the specific operation of raising a number to a given power such as a square.

= B3 ^ 2

To implement the carat operator on your number in cell B3, select an empty cell and paste the above formula into the formula bar.

The above value 2 following the carat operator is called the exponent of your number. Specifying 2 as your exponent will square the number.

Your number has been squared!

Hover the cursor over the active cell fill handle and double-click to fill the formula down.

Square a Number with the POWER Function

The POWER function is an expert way to calculate a number involving an exponent.

= POWER( B3 , 2 )

To square your number from cell B3 using the POWER function, select an empty cell and paste the above formula into the formula bar.

The second argument is 2. This is the exponent of your number, so always specify 2 here for squaring.

Press Enter when done and see how your number gets squared!

To apply your formula to your other numbers, hover over the lower-right corner of the formula’s cell until your cursor turns to a plus (+), then double-click.

Square a Number with the PRODUCT Function

The PRODUCT function provides general multiplication of values in Excel. Because squaring is just a specific case of multiplication, you can use PRODUCT to square your number.

= PRODUCT( B3 , B3 )

To use PRODUCT against your number in cell B3, select an empty cell and paste the above formula into the formula bar.

Your cell B3 is specified twice in the above formula because you’d like to multiply the B3 number by itself.

Press Enter to calculate the square of your number!

Double-click on the active cell fill handle to copy and paste the formula down your column.

Square a Number with the SUMSQ Function

Though the SUMSQ function is generally used for the summation of squared numbers, its summation feature is optional, leaving you the ability to simply square a single number.

= SUMSQ( B3 )

To leverage SUMSQ for a number in cell B3, select an empty cell and paste the above formula into the formula bar.

You only need to provide your value from the cell B3 and SUMSQ will square it.

Press Enter and behold your squared number!

Double-click on the fill handle to copy down the formula.

Square a Number with Paste Special

Excel has a paste special feature that allows you to multiply copied numbers.

To square numbers using this feature, you copy your numbers to the clipboard, then paste over it with an instruction to multiply it by the clipboard contents.

Here’s how it works for a range of numbers.

  1. Select your range of numbers.
  2. Copy your numbers to the clipboard by selecting Copy under the Home ribbon tab or press Ctrl + C.

  1. While your number range is still selected, go to the Home ribbon tab, drop down the Paste menu and select Paste Special.

Alternatively, you can simply press Ctrl + Alt + V.

This will open the Paste Special menu.

  1. Select Multiple from the Paste Special dialog.
  2. Click on the OK button.

Each number in your selected range has now been squared!

Square a Number with Power Query

Power Query is a powerful data transformation tool for Excel table data.

Once your numbers are arranged in a table, you can create a query that dynamically squares your numbers by using a Power Query formula.

Follow these steps to get started.

  1. Select your range of numbers, including the column header.

  1. Select From Table/Range under the Data ribbon tab.

  1. At the Create Table prompt, click OK to convert your range into a table.

  1. Go to the Transform ribbon tab in the Power Query Editor.
  2. Click on the Scientific menu in the Numbers Column.

  1. Select the Power submenu.
  2. Select the Square option.

Your numbers have now been squared!

You can then place the squared numbers on your sheet.

  1. Under the Home ribbon tab, drop down the Close & Load menu and select Close & Load To.

  1. Choose a destination for your results. For example, choose the Existing worksheet starting at cell D2.
  2. Click OK.

Now your squared numbers appear as a range alongside your original numbers!

Square a Number with VBA

VBA is the code responsible for automating tasks in Excel.

If you’d like to square numbers in a range based on what is currently selected, VBA would be a good way to do that.

Here’s how to explore this option.

  1. First ensure that you see the Developer ribbon tab, since it may be hidden by default.

  1. Go to the Developer ribbon tab.
  2. Click Visual Basic or simply press Alt + F11.

  1. From the Visual Basic editor select the Insert menu.
  2. Select the Module menu item.
Sub SquareNumbers()
Dim selectedRange As Range
Set selectedRange = Application.Selection

For Each cell In selectedRange.Cells
    If Len(cell.Value) > 0 Then
        cell.Value = cell.Value * cell.Value
    End If
Next cell
End Sub

  1. In the new module window, paste the above VBA code.

The code will retrieve each cell in the currently-selected range selectedRange.

The cell’s value will get updated to a multiple of itself, effectively squaring the number. The Len() function is used to skip blank cells to which squaring does not apply.

  1. To run your code, go back to your sheet and select your range of numbers.

  1. Under the View ribbon tab, select Macros.

  1. Select your SquareNumbers macro.
  2. Click the Run button.

Tada! Your numbers have been squared in place!

Square a Number with Office Scripts

Office Scripts is the latest automation language available in Excel for the web if you have a Microsoft 365 business plan.

With Office Scripts, you can create a reusable script to automate the squaring of your numbers in a selected range.

Follow these steps to start your script.

  1. Go to your browser and open your workbook in Excel for the web.

  1. Go to the Automate ribbon tab.
  2. Select the New Script option.
function main(workbook: ExcelScript.Workbook) {
    let range = workbook.getSelectedRange();
    let rowCount = range.getRowCount();
    let colCount = range.getColumnCount();

    for (let row = 0; row < rowCount; row++) {
        for (let col = 0; col < colCount; col++) {
            let currCell = range.getCell(row, col);
            let currValue = currCell.getValue();
            if (currValue.toString().length > 0) {
                currCell.setValue(currValue * currValue);
            };
        };
    };
}

  1. Paste the above script in the Code Editor pane.

The script gets the currently-selected range and loops through each cell.

The cell’s value gets updated to a multiple of itself. This squares the number before moving to the next cell.

This avoids updating blank cells by checking the length of the cell value before multiplying the value.

  1. Save your script by clicking the Save script button.

You can then run your script.

  1. Select your desired range of numbers.
  2. Click the Run button in the Code Editor pane.

The script has now replaced all your selected numbers with their squares!

Conclusions

In this post, you’ve seen many different options to square a number in Excel.

For a workbook whose calculations need to be easily understood, a traditional multiplication operator is a good option. Whereas the carat operator can offer a more concise formula.

The POWER, PRODUCT, or SUMSQ functions will get the job done and integrate better into a workbook that takes advantage of its unique design features.

The paste special option is an interesting way to square numbers in place on your sheet.

The Power Query option could be useful to square numbers as part of a larger workbook data transformation.

Finally, for a fully automated solution that reacts to changing range selections, VBA or Office Scripts is a good option. The choice will generally depend on which Excel app you’re using. Office Scripts is best for the web, while VBA is a good desktop alternative.

Which method do you use when you need to perform square calculations? Let me know in the comments!

About the Author

Barry O'Brien

Barry is a software development veteran with a degree in Computer Science and Statistics from Memorial University of Newfoundland. He specializes in Microsoft Office and Google Workspace products developing solutions for businesses all over the world.

Понравилась статья? Поделить с друзьями:
  • To springclean word formation
  • To spread the word synonyms
  • To spread the word definition
  • To spread the good word
  • To spread out the word