Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated numbers stored as text within a single cell. However, in real-world scenarios—like survey data or grouped responses—you might need to extract the most frequently occurring number (mode) from such text-based lists.

So how can you calculate the mode of comma-separated numbers in Excel when the numbers are in a single text string?

We’ll use a formula-based approach combining TEXTSPLIT, VALUE, and the MODE.MULT or MODE.SNGL functions. Since functions like MODE.MULT expect numeric arrays and not text, we first need to split and convert the values.

In this tutorial, I’ll show you two methods:

  1. A drag-down formula to find the mode for each row individually.
  2. An array formula to return the modes for an entire column at once.

Note: These methods require Excel 365 or Excel 2021 with support for dynamic arrays.

Sample Data for Mode Calculation in Excel

Assume you conducted a product survey across different regions. Each response is recorded as a comma-separated list of numeric codes representing specific reasons:

CodeMeaning
1Too Expensive
2Lack of Features
3Slow Service
4Poor Support
5Technical Issues

You’ve stored the responses region-wise as follows:

RegionResponse Codes
North1,2,1,1,1
South3,3,1,3,4
East1,1,5,4,4
West3,3,4,4,1

Your goal is to find the most common response code (mode) in each row, i.e., the mode of comma-separated numbers in Excel.

Drag-Down Formula to Find the Mode of Comma-Separated Numbers in Excel

To calculate the mode for each cell individually, enter the following formula in cell C2 and drag down:

=IFERROR(TOROW(MODE.MULT(VALUE(TEXTSPLIT(B2,",")))),"")
Example of drag-down formula to find the mode of comma-separated numbers in Excel using MODE.MULT and TEXTSPLIT

Formula Explanation

  • TEXTSPLIT(B2, ","): Splits the comma-separated string into an array of text values.
  • VALUE(...): Converts the text values to numbers.
  • MODE.MULT(...): Returns the mode(s) from the numeric array (multiple modes if they exist).
  • TOROW(...): Ensures the result appears as a single row, even if multiple modes are returned.
  • IFERROR(..., ""): Prevents errors if there’s no mode (e.g., all values are unique).

Note: If you only need a single result, replace MODE.MULT with MODE.SNGL.

Dynamic Array Formula to Find the Mode of Comma-Separated Numbers in Excel

To calculate the mode from each cell in the range B2:B5 at once, use this dynamic array formula:

=DROP(
   IFNA(
      REDUCE(
         0, B2:B5, 
         LAMBDA(acc, val, 
            VSTACK(acc, IFERROR(TOROW(MODE.MULT(VALUE(TEXTSPLIT(val, ",")))), ""))
         )
      ), ""
   ), 1
)

How the Array Formula Works

  • REDUCE: Loops through the range B2:B5 and builds the result row by row.
  • TEXTSPLIT + VALUE: Splits and converts each string into a numeric array.
  • MODE.MULT: Computes the mode(s) for each array.
  • TOROW: Ensures the output remains in a single row per item.
  • IFERROR(..., ""): Catches and suppresses any errors (such as no mode).
  • VSTACK: Stacks each row result vertically.
  • DROP(..., 1): Removes the initial zero used as the seed value in REDUCE.
  • IFNA(..., ""): Handles any empty or error outputs.

Can You Use the Same Formula in Google Sheets?

No. While the logic is similar, the formulas are not interchangeable due to key differences:

ExcelGoogle Sheets
Uses TEXTSPLIT and VALUEUses SPLIT (automatically converts to numbers)
IFERROR/IFNA require second argumentSecond argument is optional
Uses REDUCE for row-wise computationUses MAP instead

In Excel, especially when using MODE.MULT with dynamic arrays, we need REDUCE and VSTACK to return per-row results.

Real-Life Use Case: Survey Response Analysis

Let’s say you’re analyzing survey responses collected from different regions. Each region’s data represents responses from multiple individuals, with each respondent selecting one reason for dissatisfaction. The responses were then compiled into a single cell per region as comma-separated numeric codes. To summarize the feedback, you want to identify the most frequently selected reason in each region.

Finding the mode of comma-separated numbers in Excel is ideal for such cases where grouped numeric responses—each representing a single response from multiple individuals—are stored as text in one cell.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

How to Calculate Digital Root in Google Sheets

The digital root is the single-digit value you get by repeatedly summing the digits...

How to Build an Advanced Book Tracker in Google Sheets: Formulas Explained

If you're tired of forgetting what you've read, which books you rated 5 stars,...

Google Sheets Reading List Tracker Template (Free Download)

Looking for a smarter, more visual way to manage your reading goals? This Google...

Custom Order for QUERY Pivot Headers in Google Sheets

By default, when you use the PIVOT clause in a Google Sheets QUERY, the...

More like this

Sort Each Row Individually in Excel Using a LAMBDA Formula

Sorting rows in Excel typically refers to rearranging entire datasets based on values in...

Sort by Field Labels Using the SORT and XMATCH Combo in Excel

Want to sort your Excel data by column names instead of column positions? Learn...

Dynamic Way to Insert Blank Rows in a Table in Excel

Do you want to easily insert n number of blank rows in a table...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.