logo
search
Formula Errors

How to Copy Names When Adjacent Cells Contain Yes in Excel

Camila MilosovichCamila Milosovich Sep 30, 2026 869 views

Question details

The user needs an Excel formula to automatically aggregate and display names from multiple worksheets into a summary sheet if the adjacent status cell contains 'Yes'.

How to Copy Names When Adjacent Cells Contain Yes in Excel
Product
Excel
Device & OS
not provided
Scenario
Consolidating on-call rosters or status lists from several different worksheets into one master summary sheet based on a specific condition.
Observed behavior
The user wants the summary worksheet to update dynamically in real-time as individual office sheets are modified.
Before you start

Ensure you are using a modern version of Excel that supports dynamic array functions like FILTER and VSTACK (such as Microsoft 365 or Excel 2021) for this solution to work seamlessly.

Solution 1Recommended

Use FILTER and VSTACK Dynamic Array Formula

Combine multiple sheet ranges using VSTACK and filter the results using the FILTER function based on the 'Yes' criteria.

This method utilizes advanced dynamic array functions to stack the data from multiple tabs into a single virtual array. It then filters that array to only output rows where the adjacent cell value is exactly 'Yes'. Since it is dynamic, any updates made on the individual office sheets will instantly reflect on the master summary sheet.

1
Select Target Cell

Click on the top-left cell in your master summary worksheet where you want the compiled list of names to begin displaying.

2
Enter the VSTACK and FILTER Formula

Type the formula: =FILTER(VSTACK(Sheet2:Sheet5!A2:B10), CHOOSECOLS(VSTACK(Sheet2:Sheet5!A2:B10), 2)="Yes"). If your sheets are named differently, replace 'Sheet2:Sheet5' with your actual sheet names, and adjust 'A2:B10' to match your data range.

3
Execute the Formula

Press Enter. The formula will automatically 'spill' the filtered names and their corresponding 'Yes' values into the adjacent cells.

Use FILTER and VSTACK Dynamic Array Formula
Compatibility Note: VSTACK and CHOOSECOLS are relatively new functions. If you see a #NAME? error, your version of Excel does not support them. You may need to upgrade or use Microsoft 365.
WPS Spreadsheet Solution

Easily Manage Data Across Multiple Sheets with WPS Spreadsheet

WPS Spreadsheet natively supports advanced data consolidation features and dynamic array formulas, allowing you to seamlessly pull data based on specific criteria like 'Yes' across multiple tabs.

  1. 1. Open Your File: Launch WPS Spreadsheet and open the workbook containing your office rosters.
  2. 2. Select the Summary Area: Click on the starting cell in your summary sheet where the filtered names should appear.
  3. 3. Apply the Formula: Input your preferred dynamic formula, utilizing FILTER to look up the 'Yes' criteria.
  4. 4. Review Dynamic Results: Press Enter to instantly display all matching names. Data will update automatically as changes are made.
Fully compatible with Microsoft Excel formulas and file formats (.xlsx).Advanced functions like FILTER are supported for seamless data extraction.Lightweight, fast, and completely free to download for everyday office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my FILTER formula return a #CALC! error?

This error typically occurs if no cells in your specified range meet the 'Yes' criteria. You can fix this by adding an 'if_empty' argument to the end of the FILTER function, like =FILTER(range, criteria, "No one on call").

Can I use this formula on older versions of Excel like Excel 2016 or 2019?

No, functions like VSTACK, CHOOSECOLS, and FILTER are dynamic array functions introduced in newer versions (Microsoft 365, Excel 2021). For older versions, you would need to use complex INDEX/MATCH array combinations, Power Query, or VBA macros.

How do I exclude the 'Yes' column from the final results so only names appear?

If you only want to return the names (assuming they are in the first column), wrap your primary VSTACK data range inside the CHOOSECOLS function to only output column 1. The formula would start like this: =FILTER(CHOOSECOLS(VSTACK(Sheet2:Sheet5!A2:B10), 1), ...).

Is the formula case-sensitive when looking for 'Yes'?

Standard logical tests in Excel formulas (like ="Yes") are not case-sensitive. It will successfully identify 'Yes', 'yes', or 'YES' in the adjacent cells.