How to Return Headers for Non-Empty Cells in Excel 2013
Question details
The user needs to retrieve the column headers (transaction dates) corresponding to the first, second, third, and fourth non-empty transaction cells for specific customers.

- Product
- Excel 2013
- Device & OS
- not provided
- Scenario
- Extracting corresponding dates from a header row for customer transactions within a large dataset, where many cells may be blank and modern functions like FILTER are unavailable.
- Observed behavior
- The user requires an array-like formula approach to identify numerical transaction entries across columns and dynamically pull their respective date headers without returning errors for blank matches.
Ensure your transaction data is organized uniformly, with customer names in a single column and dates formatted consistently in the top header row. Because this solution involves array calculations over potentially large ranges (e.g., 50,000 records), consider saving your workbook and temporarily setting calculation options to Manual to prevent freezing.
Use the AGGREGATE Function to Extract Date Headers
The AGGREGATE function is an excellent alternative to FILTER in older Excel versions, allowing you to ignore errors and extract specific matching values incrementally.
By utilizing the AGGREGATE function with function number 15 (SMALL) and option 6 (Ignore errors), you can process arrays and find the nth matching date header. This avoids the need for traditional CSE (Ctrl+Shift+Enter) array formulas while still handling blank transaction cells smoothly.
Set up a new area below or beside your table where you want the extracted dates to appear. Place your target customer name in a designated cell, such as A7.
In cell B7, enter the following formula: =IFERROR(AGGREGATE(15,6,$B$1:$F$1/(($A$2:$A$4=$A7)*ISNUMBER($B$2:$F$4)),COLUMNS($A:A)),"None"). Adjust the ranges $A$2:$A$4 (customer names), $B$1:$F$1 (dates), and $B$2:$F$4 (transactions) to match the exact dimensions of your actual dataset.
Click the bottom-right corner of cell B7 and drag the fill handle to the right (e.g., to C7, D7, E7) to extract the 2nd, 3rd, and 4th transaction dates. Then, drag the fill handle down to apply the formula to other customers.
Select the cells containing the formula results. Right-click, choose 'Format Cells', navigate to the 'Number' tab, select 'Date', and choose your preferred date format.

Process Large Datasets Effortlessly with WPS Spreadsheet
WPS Spreadsheet fully supports advanced functions like AGGREGATE, IFERROR, and modern dynamic arrays. It provides a lightweight, highly compatible environment optimized for processing massive datasets without freezing or crashing.
- 1. Open Your Dataset: Launch WPS Spreadsheet and open your existing .xlsx workbook containing the customer transaction records.
- 2. Apply the AGGREGATE Formula: Select the target cell in your output table and paste the AGGREGATE formula, adjusting the absolute ranges to fit your data layout.
- 3. Fill and Auto-Format: Drag the fill handle across your desired columns and rows. Use the 'Format Painter' or the Home tab formatting options to easily set the output as dates.

Frequently Asked Questions
Why does my formula return 'None' instead of a date?
The IFERROR function wraps the core formula to handle cases where a customer does not have enough transactions. For example, if you drag the formula to find the fourth transaction but the customer only has two, AGGREGATE returns an error, which IFERROR catches and replaces with the word 'None'.
Can I use the FILTER function instead of AGGREGATE?
If you are strictly using Excel 2013, the FILTER function is unavailable as it was introduced in newer versions. However, if you upgrade to a modern suite like WPS Office Spreadsheet, you can utilize modern dynamic array functions like FILTER, which calculate much faster on large datasets.
How can I speed up calculations for 50,000 records?
Array-like calculations using AGGREGATE over large ranges (like 50,000 rows by 90 columns) demand heavy processing power. To improve speed, sort your data first to limit the range, change your Calculation Options to 'Manual' under the Formulas tab, or consider using Power Query to unpivot the data and filter out empty transactions.




