How to Check URLs in Google Sheets and Excel (2026 Guide)
Spreadsheets are where most URL lists live. Whether you are managing a list of backlinks in Google Sheets, tracking affiliate links in Excel, or auditing a site migration checklist, the natural question is: can I check these URLs right here in my spreadsheet?
The answer is yes -- with caveats. Both Google Sheets and Excel offer ways to validate URLs programmatically, but each method comes with hard limits that matter once your list grows past a few hundred rows. This guide walks through the practical approaches for each platform, with working code you can copy and paste, and explains when it's time to move to a purpose-built tool.
Checking URLs in Google Sheets
Google Sheets gives you two options for URL checking: a built-in function approach and a custom Apps Script. The built-in method is simpler but far less useful.
Option 1: IMPORTDATA Formula (Quick but Limited)
The simplest way to test whether a URL is reachable from Google Sheets is the IMPORTDATA function. Place your URLs in column A starting at row 2, then enter this formula in cell B2:
=IF(ISERROR(IMPORTDATA(A2)), "BROKEN", "OK")This tries to fetch data from the URL. If the request fails, the cell shows "BROKEN". If it succeeds, you get "OK". Drag the formula down to cover your list.
The problems with this approach are significant:
- Google Sheets limits
IMPORTDATAto 50 calls per spreadsheet. If you have 51 URLs, the 51st will fail regardless of whether the link works. - You get no HTTP status code -- just pass or fail. A 301 redirect and a 500 server error look the same.
- The function is slow. Each cell can take several seconds to resolve, and they process sequentially.
- Results can cache unpredictably, showing stale data hours after a URL goes down or comes back up.
For anything beyond a quick spot-check of 10-20 URLs, skip this method and use Apps Script instead.
Option 2: Google Apps Script (Better Control)
Google Apps Script lets you write JavaScript that runs on Google's servers and interacts with your spreadsheet. This approach gives you actual HTTP status codes and can handle more URLs than IMPORTDATA.
To set it up, open your spreadsheet, go to Extensions > Apps Script, and paste this code:
function checkUrl(url) {
if (!url || url.toString().trim() === '') return 'No URL';
try {
var options = {
muteHttpExceptions: true,
followRedirects: true,
validateHttpsCertificates: false
};
var response = UrlFetchApp.fetch(url.toString().trim(), options);
return response.getResponseCode();
} catch (e) {
return 'ERROR: ' + e.message;
}
}
function checkAllUrls() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
var urls = sheet.getRange('A2:A' + lastRow).getValues();
var results = [];
for (var i = 0; i < urls.length; i++) {
var url = urls[i][0];
if (!url || url.toString().trim() === '') {
results.push(['']);
continue;
}
var status = checkUrl(url);
results.push([status]);
// Flush every 50 rows to avoid timeout
if ((i + 1) % 50 === 0) {
sheet.getRange('B2:B' + (i + 2)).setValues(
results.concat(Array(lastRow - results.length - 1).fill(['']))
);
SpreadsheetApp.flush();
}
}
sheet.getRange('B2:B' + lastRow).setValues(results);
}You can use this in two ways:
- As a custom function: Type
=checkUrl(A2)in cell B2 and drag it down. Each cell calls the function independently. - As a batch function: Run
checkAllUrls()from the Apps Script editor (or attach it to a button). This processes all URLs in column A and writes status codes to column B.
The batch approach is better because it flushes results to the sheet every 50 rows, so you don't lose everything if the script times out.
Conditional Formatting for Visual Feedback
After running the script, add conditional formatting to column B so you can scan results at a glance:
- Green for values between 200 and 299 (success)
- Yellow for values between 300 and 399 (redirects)
- Red for values 400 and above, or cells containing "ERROR"
Select column B, go to Format > Conditional formatting, and add custom formula rules using =AND(B2>=200, B2<300) for green, and so on.
Checking URLs in Excel
Excel doesn't have a built-in URL fetching function like Google's IMPORTDATA. To check URLs in Excel, you need either a VBA macro or Power Query. VBA is the more common approach.
Option 1: VBA Macro
Press Alt + F11 to open the VBA editor, insert a new module (Insert > Module), and paste this code:
Sub CheckURLs()
Dim http As Object
Dim url As String
Dim statusCode As Variant
Dim lastRow As Long
Dim i As Long
Set http = CreateObject("MSXML2.XMLHTTP")
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
For i = 2 To lastRow
url = Trim(Cells(i, 1).Value)
If url = "" Then
Cells(i, 2).Value = ""
GoTo NextURL
End If
' Ensure URL has a protocol
If Left(url, 4) <> "http" Then
url = "https://" & url
End If
On Error Resume Next
http.Open "HEAD", url, False
http.setRequestHeader "User-Agent", "Mozilla/5.0 (BulkURLChecker)"
http.send
If Err.Number = 0 Then
Cells(i, 2).Value = http.Status
Cells(i, 3).Value = http.getResponseHeader("Location")
Else
Cells(i, 2).Value = "ERROR"
Cells(i, 3).Value = Err.Description
Err.Clear
End If
On Error GoTo 0
' Update status bar
Application.StatusBar = "Checking URL " & i - 1 & " of " & lastRow - 1
NextURL:
Next i
Application.StatusBar = False
Application.ScreenUpdating = True
MsgBox "Done. Checked " & lastRow - 1 & " URLs.", vbInformation
End SubTo run it, close the VBA editor, then press Alt + F8, select CheckURLs, and click Run. The macro reads URLs from column A, writes status codes to column B, and puts the redirect Location header (if any) in column C.
Option 2: Power Query (No Code)
If you prefer not to write VBA, Power Query can fetch web content from URLs. However, it's designed for data import, not link checking. The general approach:
- Go to Data > Get Data > From Other Sources > From Web
- Enter a URL and let Power Query connect
- Use the
Web.Contentsfunction in a custom column to fetch each URL - Wrap it in a
try...otherwiseblock to catch errors
The Power Query approach is fragile for URL checking because it tries to parse the page content rather than just checking the HTTP status. It also has no way to return status codes directly. For most users, the VBA macro is the better option.
Excel for Mac Limitations
The VBA macro above uses MSXML2.XMLHTTP, which is a Windows-only COM object. On Mac, you would need to use MacScript or shell out to curl, both of which are more complex and less reliable. If you are on a Mac and need to check URLs from a spreadsheet, Google Sheets is the easier path.
Skip the Macros -- Check Up to 75,000 URLs
Upload your spreadsheet export and get a full report with status codes, redirect chains, and response times. 300 free checks, no macros or scripts required.
Check URLs Free →Limitations of Spreadsheet-Based URL Checking
Both Google Sheets and Excel can check URLs, but they share fundamental limitations that become deal-breakers at scale. Understanding these helps you decide when it's time to switch tools.
Rate Limiting and IP Blocking
When you check hundreds of URLs from a single IP address (your computer for Excel, Google's servers for Sheets), target websites often throttle or block your requests. You will start seeing 429 (Too Many Requests) or 403 (Forbidden) responses that have nothing to do with the actual link status.
Spreadsheet methods have no proxy rotation. Every request comes from the same IP, which makes you easy to rate-limit. A dedicated bulk link checker rotates through multiple IP addresses automatically, avoiding these false negatives.
Execution Time Limits
Google Apps Script has a hard 6-minute execution limit. If your script hasn't finished checking all URLs within 6 minutes, it stops. For a list of 500 URLs where each takes 1-2 seconds to respond, you are already past the limit.
Excel VBA doesn't have a formal timeout, but it's single-threaded. Checking 1,000 URLs sequentially at 1 second each takes over 16 minutes, during which Excel is completely frozen. You can't use your machine for anything else.
No Concurrency
Neither Google Apps Script nor Excel VBA supports concurrent HTTP requests natively. Each URL is checked one at a time. A dedicated URL checker runs hundreds of requests in parallel, finishing in minutes what a spreadsheet takes hours to do.
Cannot Handle JavaScript-Rendered Pages
Many modern websites use client-side JavaScript to render content. A simple HTTP request returns the initial HTML shell, which might be a blank page or a loading screen. The actual content -- and any error messages -- only appear after JavaScript executes.
Spreadsheet-based methods send plain HTTP requests. They can't execute JavaScript, which means they won't detect soft 404s on JavaScript-heavy sites. The request returns a 200 status code even when the page shows a "Page Not Found" message to real users.
No Redirect Chain Tracking
The Apps Script function follows redirects automatically and returns the final status code, but it doesn't tell you how many hops were involved or what the intermediate URLs were. The Excel VBA macro can capture the Location header for the first redirect, but won't follow the full chain.
For SEO audits and migrations, knowing the complete redirect chain is critical. A 301 that chains through three intermediate URLs before reaching the destination wastes link equity and slows down page loading.
No Retry Logic or Error Recovery
If a server is temporarily slow or returns a timeout, spreadsheet methods mark the URL as broken and move on. There is no retry with exponential backoff, no distinction between a permanently dead URL and one that was just slow for 2 seconds. This leads to false negatives that pollute your results.
When to Switch to a Dedicated Tool
Spreadsheet methods work well for quick checks on small lists. Here are the signals that you have outgrown them:
- Your list has more than 200-300 URLs. At this point, you're hitting timeout limits in Google Sheets and spending significant time waiting in Excel.
- You need to check URLs regularly. Monthly link audits, weekly migration checks, or ongoing backlink monitoring don't work well as manual spreadsheet tasks.
- You are getting false 403 or 429 responses. This means target servers are rate-limiting your requests. Without proxy rotation, the problem only gets worse.
- You need redirect chain details. SEO audits and site migrations require knowing every hop in a redirect chain, not just the final destination.
- You are checking JavaScript-heavy sites. Single-page applications, React sites, and other JS-rendered pages need a headless browser to check properly.
- Accuracy matters. If you're making business decisions based on the results -- like which pages to redirect during a migration or which backlinks to disavow -- false negatives from a spreadsheet can be costly.
For a comprehensive look at bulk checking approaches beyond spreadsheets, see our developer guide to bulk URL checking.
Combining Spreadsheets with Dedicated Tools
You don't have to abandon spreadsheets entirely. A practical workflow combines both:
- Maintain your URL lists in Google Sheets or Excel. Spreadsheets are great for organizing, categorizing, and collaborating on URL lists.
- Export to CSV for bulk checking. When you need to validate the list, export it as a CSV and upload it to a batch URL checker. Our guide on validating URLs from CSV files covers this workflow in detail.
- Import results back into your spreadsheet. Download the results CSV and import it alongside your original data for analysis, filtering, and reporting.
This gives you the collaboration and organization benefits of spreadsheets with the speed, accuracy, and scale of a dedicated checking tool.
Tips for Better Results in Spreadsheets
If you do use the spreadsheet methods, these practices will improve your results:
- Clean your URLs first. Remove duplicates, trim whitespace, and filter out non-HTTP URLs like
mailto:andjavascript:links. This reduces wasted checks and avoids errors. - Add protocols to bare domains. Both scripts handle this, but it's cleaner to ensure all URLs start with
https://before running the check. - Run checks in batches. In Google Sheets, check 50-100 URLs at a time to stay within the execution time limit. In Excel, break large lists into multiple runs so your machine isn't locked up for 30 minutes straight.
- Check during off-peak hours. Running checks at 3 AM local time for the target servers reduces the chance of hitting rate limits.
- Record the date of each check. URL status changes over time. Add a timestamp column so you know how fresh your data is.
- Use HEAD requests when possible. The VBA macro uses HEAD requests, which are faster because they don't download the page body. The Apps Script version uses GET by default -- you can modify it to use
{ method: 'head' }in the options, though some servers don't support HEAD requests.
Summary
Google Sheets and Excel can both check URLs, and for small lists they work well enough. Google Sheets with Apps Script gives you status codes for up to a few hundred URLs without installing anything. Excel with VBA handles similar volumes on Windows machines with more control over the HTTP request.
The ceiling for both approaches is roughly 200-500 URLs before you hit timeout limits, rate limiting, or unacceptable wait times. Beyond that threshold, the limitations compound: no proxy rotation, no concurrency, no JavaScript rendering, no redirect chain tracking. These are not minor inconveniences -- they produce inaccurate results that undermine the entire purpose of checking.
For regular audits or lists beyond a few hundred URLs, export your spreadsheet to CSV and use a dedicated tool. You keep the organizational benefits of your spreadsheet while getting reliable results at scale.
Outgrown Your Spreadsheet? Check URLs at Scale
Upload your URL list and get accurate status codes, full redirect chains, and response times for up to 75,000 URLs. 300 free checks to start.
Try Bulk URL Checker Free →Related Articles
How to Check for 404 Errors on Your Website →
Find and fix 404 errors hurting your SEO with Google Search Console, crawlers, and bulk checkers.
Free vs Paid Broken Link Checkers →
When free tools are enough and when you need a paid broken link checker.
How to Find Broken Links on Any Website (2026 Guide) →
Free methods, browser tools, and bulk checking to find and fix broken links on any website.