Back to IPinfo in Excel
SheetXAI logo
IPinfo logo
IPinfo · Excel Guide

Fast ASN and Country Enrichment for Large IP Logs in an Excel workbook

2026-05-14
5 min read

The Scenario

You're a DevOps engineer. Last night's access log has 50,000 rows. Before the weekly security sync at 2 PM, you need to add a country code and ASN column to each row so the security team can filter by geography and identify bot traffic from known hosting ASNs. Full geolocation — city, coordinates, region — is more data than you need and would slow the lookup unnecessarily.

The log came in as a CSV, someone opened it in Excel, and now it's a workbook with 50,000 rows in column A. You have until 1:30 PM to have the enriched file ready.

The bad version:

  • Write a script: call the IPinfo lite batch endpoint in chunks of 1,000, handle pagination, parse country code and ASN from each batch response.
  • Run the script, hit a timeout on batch 34, add timeout handling, rerun.
  • Export the enriched output to CSV, open in Excel, join with the original log on IP address, check row alignment.

20 minutes of writing, 10 minutes of running, 15 minutes of reformatting and alignment verification. Not a disaster, but it's all time you needed for something else.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Excel workbook. It batches the IPinfo lite lookup automatically, handles pagination across all 50,000 rows, and writes country code and ASN to your columns without leaving Excel.

Open the SheetXAI sidebar and paste:

For all IPs in column A, use IPinfo lite batch lookup (batches of 1,000) to retrieve the country code and ASN name and write them to columns B and C, processing rows 1 through 50000.

What You Get

  • Column B: two-letter country code for each IP (US, DE, CN, etc.)
  • Column C: ASN organization name (e.g., "AS16509 Amazon.com, Inc.")
  • All 50,000 rows processed in sequential batches, rate limits handled automatically
  • Rows where lite lookup returns no data get empty cells, not errors — easy to filter

What If the Data Is Not Quite Ready

The IP is embedded in a log line, not isolated in its own cell

Column A contains raw log lines in the format "2024-04-01 08:32:11 GET /api/v2/data 200 203.0.113.44". Extract the IP address from each row (last space-separated token), run IPinfo lite batch lookup to get country code and ASN, and write to columns B and C.

I want to pre-flag high-risk countries before the security sync

Run IPinfo lite batch lookup on all IPs in column A, write country code to column B and ASN name to column C. Flag any row where the country code is CN, RU, KP, IR, or BY as "High Risk" in column D, blank for all others.

I need the ASN number as well as the organization name for firewall rules

Run IPinfo lite batch lookup for all IPs in column A. Write country code to column B, ASN number (e.g., AS16509) to column C, and ASN organization name to column D. Where lite lookup returns no data, write "Unknown" in columns B and C.

Full pre-filter pipeline ready for the security sync

Column A has 50,000 raw log IPs. Run IPinfo lite batch lookup in batches of 1,000. Write country code to column B and ASN name to column C. Flag column D: "High Risk" for CN/RU/KP/IR/BY, "Hosting ASN" if the ASN name contains Amazon, Google, Microsoft, DigitalOcean, or Linode, and "Clean" otherwise. Write a summary worksheet called "Pre-Filter Summary" with counts per flag category.

Security sync pre-filter done with time to spare.

Try It

Get the 7-day free trial of SheetXAI and open any Excel workbook with a large access log or IP list, then ask it to run IPinfo lite batch enrichment and flag high-risk rows before your security review. See also full geolocation enrichment with city and region or reverse-DNS hostname resolution. Hub: IPinfo + Excel.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more