How to Copy Formulas in Excel

The Excel program has a feature that makes it easy for users to copy formulas for entire rows or columns, but you don't always get the results you want. When you receive results that are not as expected or encounter #REF and /DIV0 errors, you will definitely feel unhappy. Don't worry, though - you don't need to edit every cell in a 5,000-line spreadsheet. This article will provide some simple ways to help you copy formulas to other cells.

Use Find and Replace to copy the exact formula

How to Copy Formulas in Excel Picture 1How to Copy Formulas in Excel Picture 1

Open the Excel spreadsheet. Surely there will be times when you have to handle large spreadsheets with many formulas, and want to copy all the information. Changing all information to an absolute cell reference can be somewhat difficult, especially when you want to review the original information immediately afterward. Use this method to quickly move a formula with a relative cell reference elsewhere without changing the reference. With the following sample spreadsheet, we will copy the formula from column C to column D without changing any elements.

Sample spreadsheet
  Column A Column B Column C Column D
line 1 944 Frog =A1/2  
line 2 636 Toad =A2/2  
line 3 712 The lizard =A3/2  
line 4 690 Snake =A4/2  

If you want to copy a formula in a cell, skip to the last step ("Try other things") of this section.

How to Copy Formulas in Excel Picture 2How to Copy Formulas in Excel Picture 2

Press Ctrl+H to open the Find window. This shortcut can be used on Windows and macOS computers.

How to Copy Formulas in Excel Picture 3How to Copy Formulas in Excel Picture 3

Find and replace the "=" sign with another character. Type "=" in the "Find what" field, then type another character in the "Replace with" box. Click Replace All to convert the entire formula (usually starting with an equal sign) into text that starts with a different character. Always use characters that you haven't used in the spreadsheet. For example, replace with # or &, or a longer string of characters, such as ##&.

Sample spreadsheet
  Column A Column B Column C Column D
line 1 944 Frog ##&A1/2  
line 2 636 Toad ##&A2/2  
line 3 712 The lizard ##&A3/2  
line 4 690 Snake ##&A4/2  

Do not use the character * or ? to avoid difficulties in the following steps.

How to Copy Formulas in Excel Picture 4How to Copy Formulas in Excel Picture 4

Copy and paste cells. Highlight the cell you want to copy, and press Ctrl + C (Windows) or Cmd + C (Mac) to copy. Next, select the cell where you want to paste the information, and press Ctrl + V (on Windows) or Cmd + V (on Mac) to paste. Since they are no longer considered formulas, they will be copied exactly.

Sample spreadsheet
  Column A Column B Column C Column D
line 1 944 Frog ##&A1/2 ##&A1/2
line 2 636 Toad ##&A2/2 ##&A2/2
line 3 712 The lizard ##&A3/2 ##&A3/2
line 4 690 Snake ##&A4/2 ##&A4/2

How to Copy Formulas in Excel Picture 5How to Copy Formulas in Excel Picture 5

Use Find & Replace again to reverse the changes. Now that you have the formulas how you want them, use "Replace All" again to reverse the changes. In the following sample spreadsheet, we will find the character string "##&" and replace it with a "=" again, so that those cells become the original formula. You can now continue editing the spreadsheet as usual:

Sample spreadsheet
  Column A Column B Column C Column D
line 1 944 Frog =A1/2 =A1/2
line 2 636 Toad =A2/2 =A2/2
line 3 712 The lizard =A3/2 =A3/2
line 4 690 Snake =A4/2 =A4/2

How to Copy Formulas in Excel Picture 6How to Copy Formulas in Excel Picture 6

Try another way. If the above doesn't work, or if you're worried about accidentally changing content in another cell using the "Replace all" feature, you can try a few things:

To copy a formula in a cell without changing the reference, you'll select the cell and then copy the formula that appears in the formula bar near the top of the window (not in the cell). Press Esc to close the formula bar, then paste the formula wherever you need it.

Press Ctrl and ` (also the ~ key) to view the spreadsheet in formula view. Copy the formulas and paste them into a text editor such as Notepad or TextEdit. Copy them again, then paste them where you want them in the spreadsheet. Next, press Ctrl and ` again to return to normal view.

Fill in the formula by column or row

How to Copy Formulas in Excel Picture 7How to Copy Formulas in Excel Picture 7

Enter the formula in an empty cell. The Excel program makes it easy for users to duplicate formulas by column or row by "filling" the cells with information. As with any other formula, you'll enter the = sign first, then enter the function or calculation you want. We will use a simple sample spreadsheet, and add the numbers in column A to column B. Press Enter or Return to see the results.

Sample spreadsheet
  Column A Column B Column C
line 1 ten 9 19
line 2 20 8  
line 3 30 7  
line 4 40 6  

How to Copy Formulas in Excel Picture 8How to Copy Formulas in Excel Picture 8

Click below the right corner of the cell whose formula you want to copy. The cursor will become a bold + sign.

How to Copy Formulas in Excel Picture 9How to Copy Formulas in Excel Picture 9

Click and drag the cursor on the column or row where you want to duplicate the formula. The entered formula is automatically entered in the cells you highlighted. Relative cell references will automatically update according to cells in the same relative position instead of remaining the same. Here is a sample spreadsheet showing the formulas used and the results:

Sample spreadsheet
  Column A Column B Column C
line 1 ten 9 =A1+B1
line 2 20 8 =A2+B2
line 3 30 7 =A3+B3
line 4 40 6 =A4+B4
Sample spreadsheet
  Column A Column B Column C
line 1 ten 9 19
line 2 20 8 28
line 3 30 7 37
line 4 40 6 forty six

You can also double-click the plus sign to fill the entire column with information instead of dragging. The Excel program will stop filling in information in the column when it sees empty cells. If the reference data has a gap, you will have to repeat this step to fill the column below the gap.

Another way to duplicate a formula for an entire column is to select the cell immediately below the cell containing the formula and press Ctrl + D .

Copy a formula into multiple cells using paste

How to Copy Formulas in Excel Picture 10How to Copy Formulas in Excel Picture 10

Enter a formula in a cell. Just like with any other formula, you'll enter the = sign first, then enter the function or calculation you need. In the simple sample spreadsheet below, we will add the numbers in column A to column B. When you press Enter or Return , the results are immediately displayed.

Sample spreadsheet
  Column A Column B Column C
line 1 ten 9 19
line 2 20 8  
line 3 30 7  
line 4 40 6  

How to Copy Formulas in Excel Picture 11How to Copy Formulas in Excel Picture 11

Select the cell and press Ctrl+C (on Windows) or ⌘ Command+C (on Mac). This is the operation of copying work to temporary memory.

How to Copy Formulas in Excel Picture 12How to Copy Formulas in Excel Picture 12

Chọn ô mà bạn muốn dán công thức đã sao chép. Nhấp vào một ô và rê chuột lên xuống hoặc sử dụng các phím mũi tên. Không giống như phương pháp nhân bản công thức theo cột hoặc dòng, các ô sắp được dán công thức không nhất thiết phải liền kề với ô có công thức mà bạn đã sao chép. Bạn có thể ấn phím Control trong khi chọn để sao chép các ô và vùng không liền kề.

How to Copy Formulas in Excel Picture 13How to Copy Formulas in Excel Picture 13

Ấn Ctrl+V (trên Windows) hoặc ⌘ Command+V (trên Mac) để dán thông tin. Bây giờ công thức đã hiển thị trong các ô được chọn.

Sử dụng tham chiếu ô tương đối và tuyệt đối

How to Copy Formulas in Excel Picture 14How to Copy Formulas in Excel Picture 14

Sử dụng tham chiếu ô tương đối trong công thức. Trong công thức Excel, "tham chiếu ô" là địa chỉ của ô. Bạn có thể nhập tham chiếu ô này theo cách thủ công, hoặc nhấp vào ô mà bạn muốn dùng trong khi nhập công thức. Ví dụ, bảng tính sau đây có công thức tham chiếu đến ô A2:

Tham chiếu tương đối
  Cột A Cột B Cột C
dòng 2 50 7 =A2*2
dòng 3 100    
dòng 4 200    
dòng 5 400    

How to Copy Formulas in Excel Picture 15How to Copy Formulas in Excel Picture 15

Tìm hiểu ý nghĩa của tham chiếu tương đối. Trong công thức Excel, tham chiếu tương đối sử dụng vị trí tương đối của địa chỉ ô. Trong ví dụ mẫu, ô C2 có công thức '=A2' là tham chiếu tương đối đến ô giá trị thứ hai bên trái. Nếu bạn sao chép công thức này vào ô C4, giá trị vẫn tham chiếu đến ô thứ hai bên trái, nhưng bây giờ là '=A4'.

Tham chiếu tương đối
  Cột A Cột B Cột C
dòng 2 50 7 =A2*2
dòng 3 100    
dòng 4 200   =A4*2
dòng 5 400    

Cách này cũng áp dụng được với ô bên ngoài bảng tính nhưng trong cùng dòng và cột. Nếu bạn đã sao chép công thức từ ô C1 vào ô D6 (không hiển thị), Excel sẽ thay đổi tham chiếu "A2" thành ô trong cột liền kề bên phải (C→D) và xuống 5 dòng (2→7), hoặc "B7".

How to Copy Formulas in Excel Picture 16How to Copy Formulas in Excel Picture 16

Sử dụng tham chiếu tuyệt đối. Giả sử bạn không muốn Excel tự động thay đổi công thức của mình. Thay vì sử dụng tham chiếu ô tương đối, bạn có thể biến nó thành tuyệt đối bằng cách thêm biểu tượng $ trước cột hoặc dòng cần giữ nguyên, bất kể bạn sao chép công thức từ đâu. Sau đây là các bảng tính mẫu hiển thị công thức gốc với cỡ chữ to và in đậm, cùng kết quả khi bạn thực hiện thao tác sao chép và dán nó vào ô khác:

Cột tương đối, dòng tuyệt đối (B$3): Công thức có tham chiếu tuyệt đối đến dòng 3, nên nó luôn tham chiếu đến dòng 3:

  Cột A Cột B Cột C
dòng 1 50 7 =B$3
dòng 2 100 =A$3 =B$3
dòng 3 200 =A$3 =B$3
dòng 4 400 =A$3 =B$3

Cột tuyệt đối, dòng tương đối ($B1): Công thức có tham chiếu tuyệt đối đến cột B, nên nó luôn tham tham chiếu đến cột B.

  Cột A Cột B Cột C
dòng 1 50 7 =$B1
dòng 2 100 =$B2 =$B2
dòng 3 200 =$B3 =$B3
dòng 4 400 =$B4 =$B4

Cột và dòng tuyệt đối ($B$1): Công thức có tham chiếu tuyệt đối đến cột B của dòng 1, nên nó luôn tham chiếu đến cột B của dòng 1.

  Cột A Cột B Cột C
dòng 1 50 7 =$B$1
dòng 2 100 =$B$1 =$B$1
dòng 3 200 =$B$1 =$B$1
dòng 4 400 =$B$1 =$B$1

How to Copy Formulas in Excel Picture 17How to Copy Formulas in Excel Picture 17

Sử dụng phím F4 để chuyển đổi giữa tuyệt đối và tương đối. Tô sáng tham chiếu ô trong công thức bằng cách nhấp vào đó và ấn F4 để tự động thêm hoặc xóa biểu tượng $. Tiếp tục ấn F4 đến khi tham chiếu tuyệt đối hoặc tương đối mà bạn muốn đã được chọn, rồi ấn Enter hoặc Return.

4 ★ | 1 Vote