Yes — you can make Excel work only with visible cells when building formulas, but the trick is that formulas themselves don't have a "visible cells only" switch. Instead you either select only the visible cells before pasting a formula into them, or you use functions such as SUBTOTAL or AGGREGATE that are designed to ignore rows hidden by a filter. Below is how to do both, with the exact shortcuts and settings.

What You'll Need

  • Excel for Windows or Mac (desktop). The steps below are written for the desktop version; the web and mobile apps have limited or different shortcuts.
  • A worksheet with some rows hidden or filtered, so you can see the effect.
  • Optional: the Select Visible Cells command added to your Quick Access Toolbar, which makes this much faster (covered in the steps).

Exact menu labels can differ slightly between Excel versions and between Windows and Mac, so if a label doesn't match word for word, look for the closest equivalent.

Step-by-Step

Method 1: Select visible cells only, then enter the formula

  1. Hide or filter the rows you don't want to touch (for example, apply a filter from Data > Filter and deselect some values).
  2. Select the range where you want the formula, including the hidden rows in the middle.
  3. Press Alt + ; (semicolon) on Windows, or Ctrl + Shift + Z on some Mac keyboards — this is the "Select Visible Cells Only" shortcut. On Mac you can also use Fn + ⌥ + ⌘ + ; depending on your keyboard layout. Excel visually marks only the visible cells as selected.
  4. Type your formula in the active cell (for example =A2*1.1).
  5. Press Ctrl + Enter (⌘ + Return on Mac) instead of plain Enter. This fills the formula into every selected visible cell at once and skips all hidden rows.
  6. Unhide or clear the filter and check: the previously hidden rows should have no formula, exactly as intended.

Method 2: Copy a formula and paste into visible cells only

  1. Create the formula in one cell and copy it with Ctrl + C.
  2. Select the destination range (with hidden or filtered rows inside it).
  3. Press Alt + ; to select only the visible cells in that range.
  4. Paste with Ctrl + V. The formula lands only in visible cells; hidden rows are left untouched.

Method 3: Use a formula that ignores hidden rows

  1. For sums over filtered data, use =SUBTOTAL(109, A2:A100). The 9 means SUM; the leading 1 tells Excel to ignore rows hidden by a filter.
  2. For other operations, use AGGREGATE, for example =AGGREGATE(9, 5, A2:A100), where 9 is SUM and option 5 ignores hidden rows.
  3. Remember the limitation: SUBTOTAL and AGGREGATE ignore filtered rows but not rows you hid manually with Hide Rows — only the selection methods above handle those.

Bonus: add Select Visible Cells to the Quick Access Toolbar

  1. Right-click the ribbon or the Quick Access Toolbar and choose Customize Quick Access Toolbar (or Customize the Ribbon and switch to the Quick Access Toolbar tab).
  2. In the "Choose commands from" dropdown, pick All Commands.
  3. Find Select Visible Cells in the alphabetical list, click Add, then click OK.
  4. You now have a one-click button that does the same as Alt + ;.

Common Mistakes

  • Pressing plain Enter instead of Ctrl + Enter in Method 1 — the formula then goes into only one cell, or overwrites hidden rows when dragged.
  • Dragging the fill handle across a range with hidden rows — this fills the hidden rows too. Always use Select Visible Cells first, then paste or Ctrl + Enter.
  • Assuming SUBTOTAL ignores manually hidden rows — it only ignores rows hidden by filters. Use AGGREGATE with the right option, or the selection method, for manually hidden rows.
  • Forgetting to remove the filter before saving — the formula is still there in hidden rows from earlier work, which causes confusion later.
  • Tips

    • Alt + ; also works when copying — you can copy only visible cells from a filtered list and paste them elsewhere without the hidden rows.
    • On Mac, if the shortcut doesn't respond, use the Quick Access Toolbar button instead — it behaves identically.
    • Combine Ctrl + Enter with a filtered view to mass-update just a subset of rows, for example recalculating prices only for one product category.
    • Give your data a name via Formulas > Define Name and reference it in SUBTOTAL formulas — it makes them readable and robust when the range grows.

    Troubleshooting

    • The shortcut does nothing: make sure a range is actually selected (not just one cell), and check keyboard layout — on some non-US keyboards Alt + ; requires a different key. Fall back to the Quick Access Toolbar button.
    • Hidden rows still got the formula: you probably skipped the Select Visible Cells step or used drag-fill instead of Ctrl + Enter. Undo with Ctrl + Z and repeat the full sequence.
    • SUBTOTAL is including rows you expected excluded: those rows were probably hidden manually, not filtered. Replace hiding with a filter, or switch to AGGREGATE.
    • Excel in the browser: Alt + ; and the Quick Access Toolbar customization are not available in the same form. Use the desktop app for this task.
    • Merged cells cause errors: Select Visible Cells behaves oddly with merged cells. Unmerge the range (Home > Merge & Center) before selecting.

    Frequently Asked Questions

    What is the shortcut to select visible cells only in Excel?

    On Windows it is Alt + ; (Alt plus semicolon). On Mac, the equivalent can be triggered via the Select Visible Cells command or a keyboard shortcut that varies by layout; adding the command to the Quick Access Toolbar is the most reliable option.

    Can a formula itself only look at visible cells?

    Not for manually hidden rows. SUBTOTAL and AGGREGATE ignore rows hidden by filters, but no worksheet function skips manually hidden rows in a calculation.

    Why does Ctrl + Enter matter?

    It enters the formula into every selected cell at once. Combined with Select Visible Cells, it's what guarantees hidden rows are skipped.

    Does Select Visible Cells work on columns too?

    Yes. It works identically for hidden or filtered columns — select the range, press Alt + ;, and only visible cells remain selected.

    Why do my pasted values land in the wrong rows?

    If you copy visible cells but paste into an unfiltered full range, Excel pastes consecutively, misaligning data. Select visible cells at the destination too before pasting.

    Is there a formula to list only visible cells?

    Not a simple built-in one. A common approach is a helper column with SUBTOTAL(103, ...) to flag visible rows, then FILTER on that flag in newer Excel versions.