How to Get the First Visible Value After Filtering in Excel
Question details
The user needs a way to extract or reference the first visible cell's value in a specific column after data filters have been applied.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Extracting the top visible record from a dataset after applying data filters, which is useful for dynamic reporting, dynamic dashboard headers, or automated summaries.
- Observed behavior
- Standard lookup functions like VLOOKUP or INDEX/MATCH retrieve values based on position without distinguishing between hidden and visible rows, resulting in incorrect data being returned when a filter is active.
Ensure your dataset has a clear header row and the data is contiguous. If you plan to use the VBA method, remember that you will need to save your workbook as a Macro-Enabled Workbook (.xlsm).
Use the INDEX, SUBTOTAL, and OFFSET Array Formula
A robust formula approach that works across most versions of Excel to extract the first visible cell in a filtered column without requiring macros.
This formula uses the SUBTOTAL function, which ignores hidden rows, combined with OFFSET to check each cell's visibility individually. INDEX is then used to return the first cell that evaluates as visible.
Click on the blank cell where you want the first visible value to appear.
Input the formula: =INDEX(C2:C100,MIN(IF(SUBTOTAL(3,OFFSET(C2,ROW(C2:C100)-ROW(C2),0)),ROW(C2:C100)-ROW(C2)+1))). Make sure to replace 'C2:C100' and 'C2' with the actual range and first cell of your target column.
If you are using an older version of Excel, press Ctrl + Shift + Enter to evaluate it as an array formula. In Excel 365 or Excel 2021, simply pressing Enter is sufficient.

Use Microsoft 365 Dynamic Array Formulas
A cleaner, modern formula approach for users with Microsoft 365, utilizing the BYROW and LAMBDA functions.
Create a Custom VBA Function (UDF)
For users who frequently need this functionality across multiple sheets, a custom VBA function (User Defined Function) provides the simplest formula syntax.
Easily Manage Filtered Data with WPS Spreadsheet
WPS Spreadsheet offers powerful functions and full compatibility with Excel's complex array formulas, making it easy to analyze and extract filtered datasets without complicated setups.
- 1. Open your workbook in WPS: Launch WPS Spreadsheet and open your existing Excel (.xlsx) file.
- 2. Apply your data filters: Go to the 'Data' tab and click 'Filter' to narrow down your dataset to the desired criteria.
- 3. Enter the formula: In a blank cell, input the recommended INDEX and SUBTOTAL array formula.
- 4. Get your result: Press Enter (or Ctrl + Shift + Enter) to instantly extract the first visible value from your filtered list.

Frequently Asked Questions
Why do standard formulas like VLOOKUP or INDEX/MATCH return hidden rows?
Standard lookup functions search based on cell contents or position and do not inherently recognize the display state (visible or hidden) of a cell. To ignore hidden rows, you must combine them with functions designed to evaluate visibility, such as SUBTOTAL or AGGREGATE.
Will the formula recalculate automatically when I change my filters?
Yes. The SUBTOTAL function is volatile, meaning it will automatically trigger a recalculation as soon as you change, add, or clear a filter on the dataset, instantly updating the returned value.
Can I use the AGGREGATE function instead of SUBTOTAL?
Yes, AGGREGATE can be an excellent alternative. By using AGGREGATE with function number 15 (SMALL) and option 5 (ignore hidden rows), you can construct a non-volatile array formula to find the first visible row number, which often performs faster on large datasets than the OFFSET method.




