Function Problems

Fix Excel CHOOSE, BYROW, and BYCOL Returning Repeated Values or Errors

Huda QurayshiHuda Qurayshi Nov 11, 2026 869 views

Question details

The user needs to resolve repeated values or #N/A errors that occur when using dynamic array formulas like CHOOSE, BYROW, and BYCOL with differently dimensioned results.

Fix Excel CHOOSE, BYROW, and BYCOL Returning Repeated Values or Errors
Product
Excel
Device & OS
not provided
Scenario
Building complex dynamic array formulas that output arrays of varying sizes or dimensions.
Observed behavior
The functions return repeated scalar values or #N/A errors instead of the expected nested or jagged array, because Excel resizes incompatible dimensions.
Before you start

Ensure you are using a version of Excel that supports dynamic array formulas (such as Microsoft 365 or Excel 2021) and review the exact dimensions of your source data arrays.

Solution 1Recommended

Reshape Jagged Arrays using REDUCE and HSTACK

REDUCE combined with HSTACK can iterate through array results of varying sizes and horizontally stack them into a single, clean rectangular array.

Excel does not natively support jagged arrays (arrays of arrays). When the selector is an array, Excel resizes the return values to compatible dimensions, which causes #N/A errors or repeated scalars. By combining the REDUCE and HSTACK functions, you can force Excel to stack arrays of varying sizes into a single rectangular grid.

1
Set up your array choices

Use the LET function to define your array selector and the various possible array outcomes you want to evaluate.

2
Apply REDUCE and HSTACK

Write a REDUCE function that iterates over the sequence of your arrays. Within its LAMBDA, use HSTACK to append each array to an accumulator variable horizontally.

3
Clean up unmatched dimensions

Wrap your final output formula in IFNA() or IFERROR() to replace any mismatched dimension #N/A errors with blank spaces ("").

Reshape Jagged Arrays using REDUCE and HSTACK
Pro Tip: You can also use VSTACK instead of HSTACK if you need your array elements stacked vertically rather than horizontally.
Free Microsoft Office alternative

A Free, Lightweight Alternative for Advanced Spreadsheets

Handling complex array formulas requires robust software. WPS Office is a powerful, free alternative to Microsoft Office that offers seamless format compatibility, a familiar interface, and excellent performance for complex spreadsheet tasks without the heavy subscription cost.

  1. 1. Download and Install: Get WPS Office for free from the official website and install it on your device.
  2. 2. Open Your Spreadsheets: Double-click your existing .xlsx files to open them directly in WPS Spreadsheet.
  3. 3. Work with Formulas: Continue using your advanced array formulas with complete compatibility.
Free and lightweight Office suiteFully compatible with Microsoft Excel (.xlsx) formatsSupports advanced functions and array formulasFamiliar UI for seamless transition
microsoft office alternative - wps office

Frequently Asked Questions

Why does CHOOSE repeat scalar values in array formulas?

When you use an array as the selector argument in CHOOSE, the application attempts to prevent a jagged array. It resizes scalar results by repeating them to match the dimensions of the array selector.

Can BYROW or BYCOL return an array of arrays?

No, spreadsheet software does not natively support nested arrays or arrays of arrays. BYROW and BYCOL require their LAMBDA function to return a single result per row or column.

How do I remove #N/A errors when generating jagged arrays?

When merging arrays of different dimensions, the empty spaces are automatically filled with #N/A errors. You can remove these by wrapping your final array formula in IFNA() or IFERROR() to replace the errors with a blank string ("").