A YouTube comment section is one of the few places where an audience tells you, unprompted and at scale, exactly what it thinks. The problem is the container. YouTube shows comments in an infinite-scrolling column sorted by an algorithm you do not control, with no way to sort, count, filter or export. Google Sheets fixes all of that — the trick is getting the data across the gap.
This guide covers three routes, in order of how much of your afternoon they cost: a no-code CSV export, the YouTube Data API driven from Apps Script, and the IMPORTDATA approach that everyone tries first and nobody gets working. Then, once the rows are in the sheet, the handful of formulas and pivots that turn a comment dump into an actual answer.
Why Sheets can't just pull the comments itself
The first thing most people try is =IMPORTDATA("https://www.youtube.com/watch?v=…") or an IMPORTXML with an XPath aimed at the comment container. Both fail, and it is worth understanding why, because the same reasoning applies to every scraping shortcut you will be tempted by.
Sheets' import functions fetch raw HTML the way a very simple crawler would. They do not run JavaScript. YouTube's comment section is not in that HTML — it is loaded afterwards by a separate request once the player is up, and the response is a deeply nested JSON structure that changes shape regularly. So IMPORTXML gets a page skeleton with a title and some meta tags, and no comments at all. It is not a formula problem. There is nothing to select.
That leaves two honest options: something that renders the page or talks to YouTube's API on your behalf and hands you a file, or the official YouTube Data API commentThreads endpoint called from code you write yourself. Route one takes about ninety seconds. Route two takes an hour and pays off if you need it to run every week.
Route 1: CSV export, then File → Import (the fast one)
This is the route that fits inside a coffee break.
Step 1 — export the comments
Copy the video URL and paste it into the YouTube comment exporter. Both URL forms work — youtube.com/watch?v=… and the short youtu.be/… from the Share button. Turn on replies if you want the full thread rather than just top-level comments; leave it off for a faster job and a cleaner first read.
The download gives you these columns:
authorandusername— display name and handletext— the comment itself, UTF-8, emoji intactlikes— the single most useful sorting column in the filereplies— how many replies that comment attractedcreated_at— timestamplanguage— detected language code, which is how you find the half of your audience you cannot readis_pinned,id,reply_to_id,avatar_url
Free tier is 3 videos a day with no signup, which is enough to do this end to end before deciding whether you need more.
Step 2 — import into Sheets properly
Open a blank Sheet, then File → Import → Upload and drop the CSV in. In the dialog:
- Import location: Replace current sheet (or Insert new sheet if you are collecting several videos in one file)
- Separator type: Comma — do not leave it on Detect automatically, which occasionally mis-reads comment text containing semicolons or tabs
- Convert text to numbers, dates and formulas: off
That last setting matters more than it looks. Left on, Sheets will helpfully convert a comment that reads "3/4" into a date, strip the leading zero from a phone number someone posted, and — the classic — turn a comment starting with = or + into a broken formula. Turn it off and every comment stays exactly as written. Google's own import documentation covers the dialog in full.
Sheets reads UTF-8 natively, so unlike Excel there is no encoding step here. If you see question marks or mojibake where emoji should be, the file was opened and re-saved in Excel somewhere along the way — import the original download instead.
Step 3 — make it usable in thirty seconds
Three actions, every time:
- View → Freeze → 1 row so headers stay put.
- Data → Create a filter for click-to-sort on every column.
- Select the text column and Format → Wrapping → Clip so long comments do not blow up the row height. You can still read the full text in the formula bar.
Sort by likes descending. The top twenty rows are, in most cases, the entire useful summary of the comment section — the questions everyone has, the complaint everyone shares, the joke that took over. YouTube's default "Top comments" sort approximates this, but only Sheets lets you keep scrolling past the point where the app stops cooperating.
Route 2: the YouTube Data API through Apps Script
Worth building when you need the same sheet to refresh itself — a weekly channel report, an always-on monitor for a product launch, a client dashboard. It is free within quota and it lives entirely inside Google's ecosystem.
Setup
In your Sheet, go to Extensions → Apps Script. In the editor, Services → + and add YouTube Data API v3 with the identifier YouTube. That enables the advanced service, which handles authentication for you — no API key to paste, no OAuth screen to configure.
Then paste something like this:
function pullComments() {
const videoId = 'VIDEO_ID';
const sheet = SpreadsheetApp.getActiveSheet();
sheet.clear();
sheet.appendRow(['author', 'text', 'likes', 'replies', 'published']);
let token = null;
do {
const res = YouTube.CommentThreads.list('snippet', {
videoId: videoId,
maxResults: 100,
pageToken: token,
order: 'relevance',
});
const rows = res.items.map(function (i) {
const c = i.snippet.topLevelComment.snippet;
return [c.authorDisplayName, c.textDisplay, c.likeCount,
i.snippet.totalReplyCount, c.publishedAt];
});
if (rows.length) {
sheet.getRange(sheet.getLastRow() + 1, 1, rows.length, 5).setValues(rows);
}
token = res.nextPageToken;
} while (token);
}
Note the batched setValues rather than a hundred appendRow calls — Apps Script is slow at the boundary between the script and the sheet, and writing one block per page is the difference between a script that finishes and one that trips the six-minute execution limit. The Apps Script quota page lists that limit and the daily runtime budget alongside it.
The quota maths nobody mentions until it bites
The YouTube Data API gives a project 10,000 quota units per day by default. A commentThreads.list call costs 1 unit and returns up to 100 comments, so 10,000 units is a theoretical million comments a day — generous. The trap is that other calls are far more expensive: a search.list costs 100 units, so a script that searches for videos before pulling their comments burns quota a hundred times faster. Google publishes the full table on the quota cost page. If you are monitoring a known list of video IDs, skip search entirely and you will never come close to the ceiling.
What the API won't give you
Three limitations to know before you invest the hour:
- Comments disabled means nothing, regardless of route. No API and no tool can read a comment section the uploader has turned off.
- Held-for-review and spam-filtered comments are invisible unless you own the channel and authenticate as its owner. Public reads see the public view.
- Reply pagination is separate.
commentThreads.listreturns a few replies inline, not all of them. Full reply trees need a second pass throughcomments.listper thread, which is where a straightforward script starts turning into a project.
Route 1 handles the reply tree for you, which is most of the reason it exists.
Route 3: IMPORTDATA, honestly assessed
There is one narrow case where a formula works: if you already have a public CSV at a stable URL, =IMPORTDATA("https://…/comments.csv") will pull it into the sheet and re-fetch it periodically. That is useful if you are dropping exports into cloud storage as part of a pipeline. It is not a way to get comments out of YouTube, because the URL has to be a CSV file that something else already produced. Anyone telling you IMPORTXML reads YouTube comments is describing a thing that stopped working, if it ever did.
What to actually build once the data is in
Import is the boring half. Here is what earns the effort back.
Language breakdown in one cell
Assuming your language column is H:
=QUERY(A1:K, "select H, count(H) where H is not null group by H order by count(H) desc label count(H) 'comments'", 1)
A ranked list of the languages in the comment section, which for most channels is the single most surprising number in the file. Once you know the split, our guide to bulk-translating comments applies unchanged — the mechanics are identical on YouTube.
Comment volume by day
Add a helper column with =DATEVALUE(LEFT(G2,10)) against your created_at column, then pivot on it with COUNTA. You get the decay curve: how long a video kept earning comments after publishing. Comparing that curve across videos tells you which formats have a long tail and which die in 48 hours — far more actionable than raw view counts.
Repeat commenters
Pivot on username with COUNTA, sort descending. The top of that list is your genuine core audience — the handful of people who show up on everything. Filter to the ones who appear on three or more of your videos and you have a community shortlist worth treating differently. The same technique across platforms is covered in finding a commenter's history by username.
Questions only
=FILTER(D2:D, REGEXMATCH(D2:D, "\?")) pulls every comment containing a question mark. Sort those by likes and you have a ranked FAQ written by your audience — the fastest content-idea generator on this list, and a direct input into a pinned comment or a follow-up video.
Keyword counting
=COUNTIF(D2:D, "*shipping*") and a small block of terms you care about — price, shipping, sizing, a competitor's name, a feature request — gives you a crude but genuinely useful theme count in about two minutes. For anything more nuanced, see how to analyze YouTube comments, which goes past keyword counting into sentiment and theme clustering.
Practical limits of doing this in Sheets
Google caps a spreadsheet at 10 million cells. At eleven columns that is around 900,000 comments on paper, and the real ceiling is much lower: past roughly 50,000 rows, filters get slow, QUERY takes seconds to recalculate, and collaborative editing starts to lag. Three ways to stay comfortable:
- Filter before importing. If you only need comments with likes, cut the file down before it reaches the sheet.
- Paste values. Once a
QUERYorGOOGLETRANSLATEcolumn has produced what you need, Copy → Paste special → Values only. Live formulas over tens of thousands of rows are what actually makes the file crawl. - Split by video. One tab per video, one summary tab pulling from each. Keeps every individual sheet fast.
If you are consistently past that point, the honest answer is that Sheets is the wrong tool — export to .xlsx and use Excel's Power Query, or load the CSVs into BigQuery, which Sheets can then query without holding the rows itself.
Which route should you take?
One video, one afternoon, one question to answer: CSV export and import, every time. The API is not more accurate and it takes fifty times longer to set up.
A recurring report that must refresh itself without anyone touching it: Apps Script. Build it once, put it on a time-driven trigger, forget it.
A dozen videos across several platforms feeding one deck: export each, import to separate tabs, roll up in a summary sheet. The column layout is identical across TikTok, Instagram, Facebook, Reddit and YouTube, so cross-platform sheets stack without reshaping anything — which is the actual reason to standardise on one exporter rather than one script per platform.
Related reading
- How to analyze YouTube comments — what to do after the import
- Exporting YouTube comments to Excel — the UTF-8 steps Excel needs and Sheets doesn't
- YouTube comment scraper guide
- The same workflow for TikTok
- YouTube Comment Exporter — 3 free exports a day, no signup
