Back to Census Bureau in Google Sheets
SheetXAI logo
Census Bureau logo
Census Bureau · Google Sheets Guide

Pull County Business Patterns by NAICS Code into Google Sheets

2026-05-13
4 min read
See the Excel version →

The Scenario

You are a franchise development manager at a restaurant chain. You have 50 candidate counties in a Google Sheet and a board presentation in ten days.

Before the board meeting you need two numbers for each county: the number of NAICS 722511 (full-service restaurant) establishments and total employees. That is your competitive density metric. The counties with the lowest density per capita go to the top of the expansion list.

The bad version:

  • You search for County Business Patterns on the Census website
  • You navigate to data.census.gov, build a filter for NAICS 722511, and realize it does not let you query 50 counties at once
  • You download 50 separate county tables across three browser sessions
  • You align the columns from each export into your master sheet
  • Three of the county exports have a different column order than the rest
  • The board meeting is in two days and you are still reconciling row 38.

The fast version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your spreadsheet that knows the County Business Patterns dataset and its API structure, so you get 50 counties in one call instead of fifty browser sessions.

Open the SheetXAI sidebar and type:

For each county in my sheet (state FIPS in column A, county FIPS in column B), pull 2021 County Business Patterns data for NAICS 722511 — establishments and total employees — into columns C and D.

SheetXAI calls the Census County Business Patterns API for all 50 counties, maps the establishment and employment fields, and writes the results into columns C and D. Counties that return no data for that NAICS get flagged rather than left blank.

What You Get

A clean enriched sheet, all 50 rows filled:

  • Column C — establishment count for NAICS 722511 per county
  • Column D — total employment for NAICS 722511 per county

These are the same CBP numbers used in commercial site-selection reports. You can cite the dataset vintage in your footnotes without a separate research step.

Want to calculate a competitive density score? Ask SheetXAI to divide the establishment count by the county population (which it can also pull from ACS in the same session) and write a density-per-10k-residents column into column E.

What If the Data Is Not Quite Ready

NAICS queries against CBP have some common edge cases. SheetXAI handles them inline.

When your county list uses names instead of FIPS codes

Your sheet has "Cook County, IL" in column A rather than state and county FIPS.

Convert the county names in column A to state FIPS and county FIPS codes. Then pull 2021 County Business Patterns data for NAICS 722511 — establishments and total employees — into columns B and C.

When you want ZIP-level data instead of county-level

Your field team thinks ZIP code is the right unit for site scoring, not county.

Import Census ZIP Code Business Patterns data for NAICS 722511 for all ZIP codes in column A and write establishment count and employment into columns B and C. Flag any ZIP with no CBP data in column D.

When you need a second NAICS code for context

You also want the count of NAICS 445 (grocery stores) as a proxy for anchor traffic near your sites.

For each county in my sheet (state FIPS in A, county FIPS in B), pull 2021 County Business Patterns establishment counts for NAICS 722511 and NAICS 445. Write restaurant establishments into column C, grocery establishments into column D.

When you need CBP plus population plus an income filter in one pass

Your board wants the final ranked list: density per capita, filtered to counties with median household income over $55,000.

For each county in my sheet (state FIPS in A, county FIPS in B), pull 2021 County Business Patterns establishment count for NAICS 722511 into column C. Also fetch ACS 5-year total population into column D and median household income into column E. Filter to counties where income is above $55,000 and write those rows ranked by establishments-per-10k-residents into a new tab called Priority Markets.

The pattern: the competitive analysis, the income filter, and the ranking happen in one prompt instead of across three separate data tools.

Try It

Get the 7-day free trial of SheetXAI and open any sheet with a list of counties or ZIP codes, then ask it to pull County Business Patterns data for a target NAICS code. The Census Bureau integration is included in every SheetXAI plan. For related workflows, see how to enrich ZIP codes with ACS demographic data or the Census Bureau in Google Sheets overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more