TOCOL is one of those quiet functions that unlocks real leverage. In Excel it takes any two‑dimensional range—campaign by channel, product by region, rep by month—and spills it into a single clean column. That one column is much easier to filter, sort, de‑duplicate, score, and feed into your models or dashboards. In Google Sheets, you can mirror the same pattern with FLATTEN and array formulas, so every pivot table, report, or revenue forecast starts from a tidy, linear dataset instead of a maze of cross‑tabs.
Where this really compounds is when an AI computer agent sits on top of the workflow. Instead of you copying ranges, rewriting TOCOL formulas, and fixing #VALUE! errors, the agent can open Excel or Sheets, apply TOCOL (or the equivalent), normalize data, rerun UNIQUE and SORT, and log what changed. You move from remembering formulas to simply asking: Every morning, flatten yesterday’s exports and update my master lead list.
If you work in sales, marketing, or at an agency, you live in spreadsheets. Campaigns by channel, territories by rep, SKUs by region – everything ends up in a grid. The problem is that most tools downstream (CRMs, BI tools, AI models) want clean, single‑column lists. That’s exactly what Excel’s TOCOL function – and TOCOL‑style patterns in Google Sheets – are for.
Below are three layers of sophistication: from manual, to no‑code, to fully agentic automation.
Use this when you have a tidy 2D range and just need it stacked into one column.
Microsoft’s official TOCOL documentation is at: https://support.microsoft.com/en-us/office/tocol-function-22839d9b-0b55-4fc1-b4e6-2761f8f122ed
TOCOL has an ignore argument:
Example for a messy export with errors:
=TOCOL(A2:D500,3)
This flattens your range into a single column and silently skips empty cells and error values (like #N/A) so you get a clean list.
For deduplicated, ordered lists:
=UNIQUE(SORT(TOCOL(A2:D500,3)))
This pattern is perfect for creating unique lead lists from multiple campaigns, consolidated product catalogs, or normalized UTM parameter sets.
If UNIQUE doesn’t seem to work after TOCOL (a common edge case), normalize the data first:
=LET(t,TOCOL(A2:D500,1), n,FILTER(VALUE(t),t<>""), UNIQUE(SORT(n)))
This coerces text numbers to real numbers and drops pseudo‑blanks before deduping.
Google Sheets doesn’t have TOCOL (yet), but you can get similar behavior using FLATTEN and array formulas.
See Google’s official function reference here: https://support.google.com/docs/table/25273
This gives you a single, stacked column you can use across dashboards and pivot tables.
Once TOCOL has spilled your list:
This is useful for one‑off analyses, list handoffs to SDRs, or importing into tools that don’t support dynamic arrays.
Once you’ve got repeatable patterns, you don’t want to be the one opening files every day. Here’s how to offload the busywork without writing code.
For Microsoft 365 users, Power Automate can run your TOCOL‑based flows on a schedule.
Typical pattern:
Reference on dynamic arrays and spilled ranges: https://support.microsoft.com/en-us/office/dynamic-array-formulas-and-spilled-array-behavior-64e5c57e-11c3-4b99-b5f2-ef20c45c0b68
Even if you’re not an engineer, a simple Apps Script can help refresh TOCOL‑style FLATTEN formulas.
Official Apps Script docs: https://developers.google.com/apps-script
No‑code integration tools like Zapier or Make can:
You’re still relying on spreadsheet formulas, but the ingestion of raw data is automated.
At some point, your workflows cross from simple to messy: multiple files, different layouts by client, dozens of little corrections that no formula or static integration fully captures. This is where an AI computer agent like Simular shines.
Simular Pro is a production‑grade computer‑use agent that can operate your entire desktop environment: open files, click through dialogs, type formulas, and integrate with browser‑based tools. Instead of you being the “glue” between exports and models, the agent becomes the glue.
Story: Every night, your SDR manager drops CSVs from three ad platforms into a folder. You used to:
With Simular:
Pros:
Cons:
For agencies juggling dozens of clients, each with their own report templates:
Pros:
Cons:
By combining strong spreadsheet patterns (TOCOL, UNIQUE, SORT, FLATTEN) with a desktop‑class AI computer agent, you move from “I have to remember how to clean this data” to “The system cleans it, I just review the story it tells.”
In modern Excel (Microsoft 365, Excel 2021+), the easiest way to flatten any rectangular range is with the TOCOL function.
1. Identify your source range, e.g., A2:D20 with campaigns as columns and dates as rows.
2. Choose an empty cell where you want the flattened list to begin, such as F2.
3. Enter:
=TOCOL(A2:D20)
4. Press Enter. Excel will spill all values from A2:D20 into a single column starting at F2, reading by row from left to right.
5. To ignore blank cells, use the ignore argument:
=TOCOL(A2:D20,1)
6. To read by columns (top to bottom down A, then B, etc.), set scan_by_column to TRUE:
=TOCOL(A2:D20,1,TRUE)
You can then wrap this TOCOL output with functions like UNIQUE, SORT, or FILTER to build clean lead lists or product catalogs. See Microsoft’s official TOCOL help for more detail: https://support.microsoft.com/en-us/office/tocol-function-22839d9b-0b55-4fc1-b4e6-2761f8f122ed
TOCOL has a built‑in ignore parameter that lets you skip blanks, errors, or both as you flatten a range.
The syntax is:
=TOCOL(array, ignore, scan_by_column)
Where ignore can be:
Example: say A2:D500 contains exports from multiple tools, with occasional #N/A errors and empty cells. To flatten this into a clean list:
If you still see unexpected results, check that cells are truly empty (not "" returned by formulas) and that numeric text is coerced properly. You can combine TOCOL with VALUE and FILTER if needed:
=LET(t,TOCOL(A2:D500,1), n,FILTER(VALUE(t),t<>""), n)
This sequence first ignores blanks, then converts text numbers and removes pseudo‑blanks before you do further analysis.
If UNIQUE doesn’t seem to remove duplicates after TOCOL, it’s usually because the values aren’t truly identical from Excel’s point of view.
Common issues:
A robust pattern is to normalize your TOCOL output before calling UNIQUE. For example:
=LET( t,TOCOL(A2:D500,1), n,FILTER(VALUE(TRIM(t)),t<>""), UNIQUE(SORT(n)) )
This does three things:
Finally, UNIQUE and SORT deduplicate and order the clean list.
If you’re still stuck, test on a smaller subset and use LEN() or CODE() on suspicious entries to reveal hidden characters. Microsoft’s TOCOL and dynamic array docs provide additional troubleshooting context.
Google Sheets doesn’t have a native TOCOL function yet, but you can achieve the same "flatten to a single column" behavior with FLATTEN, array literals, and sometimes ARRAYFORMULA.
The simplest pattern:
This stacks the 2D range into a single column, reading row by row.
If your data is spread across multiple ranges or sheets, wrap them in an array literal first:
=FLATTEN({Sheet1!A2:D10;Sheet2!A2:D10})
You can then combine this with UNIQUE and SORT for clean lists:
=UNIQUE(SORT(FLATTEN({Sheet1!A2:D10;Sheet2!A2:D10})))
For more on functions and array behavior in Google Sheets, see the official function index: https://support.google.com/docs/table/25273
This gives you TOCOL‑style workflows in Sheets that align nicely with the way you’d model data in Excel.
To automate TOCOL‑style cleanup with an AI agent, think in terms of a repeatable desktop workflow and then let the agent perform it for you.
With a computer‑use agent like Simular:
The result: your AI agent maintains your flattened, analysis‑ready columns while you focus on strategy, not spreadsheet chores.