In some cases, we hide some of our rows and columns in Excel. But if we drag the formula from there, it will drag along with the hidden cells. If you actually drag any formula and ignore hidden cells in Excel, this article is for you. This article will mainly focus on how to drag the formulas ignoring hidden cells with some valuable examples. I think you will gain some valuable knowledge about this topic.

**Table of Contents**hide

## Download Practice Workbook

Download this practice workbook.

## 2 Suitable Examples to Drag Formula and Ignore Hidden Cells in Excel

To drag the formula and ignore hidden cells in Excel, we have found three effectively through which you can gain proper knowledge about this matter. All of these examples are user-friendly and easy to digest. To show all the examples we take a dataset that includes some person and money earned from selling three different products.

### 1. Drag Formula and Ignore Hidden Cells Using SUBTOTAL Function

To drag the formula ignoring hidden cells, first, we need to utilize **the SUBTOTAL function**.

**Steps**

- At first, hide some of the rows before applying anything.
- Press
**Ctrl**and select row**7**, row**9,**and row**11**.

- Next, right-click on the select row.
- A
**Context Menu**will appear. - Select
**Hide**from there.

- It will hide all the selected rows. See the screenshot.

- Now, we need to find out the total income from product 1 sale. Here, we use the
**SUBTOTALÂ**function. - First, select cell
**D13**.

- Now, write down the following formula in the formula box.

`=SUBTOTAL(109,E5:E12)`

Here, **109** is the **function_num** which denotes** the SUM function** but will ignore hidden cells while applying.

- Press
**Enter**to apply the formula.

- Drag to the
**Fill handle**icon to the right. It will calculate the sum of product 2 and product 3. In all the cases, function ignores the hidden cells.

- Now, copy the range of cell
**B4**to**F13**by pressing**Ctrl+C**after selecting the range of cell. - Paste it at cell It will show up all the hidden cells and also change the sum value.

- But we want to drag the formula ignoring hidden cells.
- To do this, first, select the range of cells
**B4**to**F13**.

- Next, press â€˜
**Alt+;â€™**. See the screenshot.

- Then, press
**Ctrl+C**to copy the selected range of cells. It will highlight the cells in the following way. See the screenshot.

- Next, select cell
**B15**. - Then, press
**Ctrl+V**to paste the selected range of cells. - Here, you will see the cells and formula ignoring the hidden cells.

**Note:**

You canâ€™t paste the selected range of cells with some hidden cell on the right side of the original dataset. You can paste it either below the dataset or into another worksheet. The reason behind this is that you hide some cells in the dataset so if you paste it on the right side of the dataset, the paste value must use the same rows as the original dataset.

**Read More: How to Drag Formula in Excel with Keyboard (7 Easy Methods)**

**Similar Readings**

**Drag Number Increase Not Working in Excel (A Solution with Easy Steps)****How to Fill Down to Last Row with Data in Excel (3 Quick Methods)****[Fixed!] Excel Drag to Fill Not Working (8 Possible Solutions)**

### 2. Drag Formula and Ignore Hidden Cells Using AGGREGATE Function

We can drag the formula ignoring hidden cells using **the AGGREGATE function**.

**Steps**

- At first, hide some of the rows before applying anything.
- Press
**Ctrl**and select row**7**, row**9,**and row**11**.

- Next, right-click on the select row.
- A
**Context Menu**will appear. - Select
**Hide**from there.

- It will hide all the selected rows. See the screenshot.

- Now, we need to find out the total income from product 1 sale. Here, we use the
**SUBTOTALÂ**function. - First, select cell
**D13**.

- Now, write down the following formula in the formula box.

`=AGGREGATE(9,5,D5:D12)`

Here, **9** is the **function_num** which denotes **the SUM function.** Next, we will get some more options. Where **5** denotes ignore hidden rows.

- Press
**Enter**to apply the formula.

- Drag to the
**Fill handle**icon to the right. It will calculate the sum of product 2 and product 3. In all the cases, function ignores the hidden cells.

- Now, copy the range of cell
**B4**to**F13**by pressing**Ctrl+C**after selecting the range of cell. - Paste it at cell It will show up all the hidden cells and also change the sum value.

- But we want to drag the formula ignoring hidden cells.
- To do this, first, select the range of cells
**B4**to**F13**.

- Next, press â€˜
**Alt+;â€™**. See the screenshot.

- Then, press
**Ctrl+C**to copy the selected range of cells. It will highlight the cells in the following way. See the screenshot.

- Next, select cell
**B15**. - Then, press
**Ctrl+V**to paste the selected range of cells. - Here, you will see the cells and formula ignoring the hidden cells.

**Read More: How to Enable Drag Formula in Excel (With Quick Steps)**

## How to Drag Formula in Excel When Filtered

When you filter your dataset, it will create an appearance where you can hide cells. To show this process, we use **the SUBTOTAL function**.

**Steps**

- First, select the range of cells
**B4**to**F12**.

- Then, go to the
**Data**tab in the ribbon. - From
**Sort & Filter**group, select**Filter**.

- It will filter your dataset.

- Next, select cell
**D13**.

- Write down the following formula in the formula box

`=SUBTOTAL(9,D5:D12)`

Here, Here, **9** is the **function_num** which denotes** the SUM function** but will ignore unchecked filtered cells.

- Press
**Enter**to apply the formula.

- Drag to the
**Fill handle**icon to the right. It will calculate the sum of product 2 and product 3.

- Next, click on the down arrow beside the
**NameÂ**header. - Number FIlter dialog box will appear.
- From there uncheck Elijah, Noah, and Pope.
- Finally, click on
**OK**.

- It will filter the dataset and hide all three names.
- More importantly, it will change the overall sum of the three products because it allows only visible rows.

## Things to Remember

When you use the **SUBTOTAL** function, you may have to get two** function_num** **9** and **109**. But to have an effective solution, you need to use **9 function_num** when you filter your dataset and you need to utilize **109** function_num when you hide your cells manually.

## Conclusion

To drag the formula to ignore hidden cells, we have shown some suitable examples. All of these examples provide effective results and really easy to digest. If you have any questions, feel free to ask in the comment box, and donâ€™t forget to visit our **Exceldemy** page.

## Related Articles

**[Fixed!] Excel VLOOKUP Drag Down Not Working (11 Possible Solutions)****Fill Down to Next Value in Excel (5 Easy Methods)****How to Drag Formula Horizontally with Vertical Reference in Excel****[Solved]: Fill Handle Not Working in Excel (5 Simple Solutions)****How to Use Fill Handle to Copy Formula in Excel (2 Useful Examples)****How to Fill Formula Down to Specific Row in Excel (7 Easy Methods)**