Function Problems

Categorize a Dynamic Excel Array by Segment and Size

Aamir Naveed AkramAamir Naveed Akram Nov 11, 2026 868 views

Question details

The user needs to categorize a large, dynamic dataset into sizes (small, medium, large) based on segment-specific thresholds using spilled array formulas.

How to Categorize a Dynamic Excel Array by Segment and Size
Product
Spreadsheets
Device & OS
not provided
Scenario
Categorizing data points automatically based on dynamic lookup thresholds that vary by segment.
Observed behavior
Looking for a method to spill a category result for every input row using a lookup table for the thresholds, or an alternative data transformation method.
Before you start

Ensure your lookup table is properly formatted with clear thresholds for each segment, and verify that your spreadsheet software supports dynamic array functions.

Solution 1Recommended

Use Dynamic Array Formulas (IFS and XLOOKUP)

Utilize dynamic array capabilities to look up segment thresholds and spill the size categories automatically across your dataset.

Dynamic array formulas allow a single formula to output results into multiple cells. By combining functions like IFS and XLOOKUP, you can evaluate each row of your dynamic array against a separate threshold table.

1
Set up the threshold table

Create a lookup table on your worksheet containing your segments as rows and the respective limits for small, medium, and large categories as columns.

2
Select the target cell

Click the topmost cell of the column where you want the categorized results to appear.

3
Enter the dynamic formula

Input a formula referencing the entire spilled data range (using the # operator). For example, use an IFS function combined with XLOOKUP to compare the data size against the thresholds: =IFS(SizeArray#<=XLOOKUP(SegmentArray#,ThresholdTable[Segment],ThresholdTable[Small]),"Small",...)

4
Apply and spill results

Press Enter. The formula will automatically calculate and spill the categories down the column for every input row.

Use Dynamic Array Formulas (IFS and XLOOKUP)
Formula Spill: Make sure the cells below your target cell are completely empty, otherwise you will encounter a #SPILL! error.

Categorize Data Dynamically in WPS Spreadsheet

WPS Spreadsheet offers powerful dynamic array functions and data analysis tools to seamlessly categorize large datasets based on custom conditions.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing your raw dataset and threshold tables.
  2. 2. Prepare your tables: Ensure your threshold criteria are set up in a distinct table range with clear column headers.
  3. 3. Input the array formula: Select the first cell of your results column and type your dynamic array formula using XLOOKUP and IFS.
  4. 4. Spill the results: Press Enter to allow the formula to calculate and automatically spill the size categories down the entire column.
Full compatibility with Microsoft Excel dynamic array formulasLightweight application with fast calculation speedsAdvanced data manipulation and formatting tools built-in
microsoft office alternative - wps office

Frequently Asked Questions

What is a spilled array in spreadsheets?

A spilled array is a dynamic feature where a single formula calculates multiple results and automatically populates ('spills' into) adjacent empty cells.

Why am I getting a #SPILL! error?

This error occurs when the spill range is not completely blank. Check for hidden text, spaces, or formatting in the cells where the formula needs to place its results and clear them.

Can I use nested IFs instead of IFS for this categorization?

Yes, if your software does not support the newer IFS function, you can use nested IF statements combined with VLOOKUP or INDEX/MATCH to achieve the same result, though the formula will be more complex.

How does Power Query handle dynamic thresholds differently than formulas?

Power Query processes the data in the background and outputs a static table. It doesn't update instantly as you type but requires a manual data refresh, making it much more memory-efficient for extremely large datasets.