In large Google Sheets workbooks with dozens (or even hundreds) of tabs, finding specific data quickly becomes a challenge. The built-in Ctrl + F (or Cmd + F) search only works within the active sheet, forcing you to switch tabs manually. If you manage inventory, tasks, client lists, orders, or any multi-tab spreadsheet, a single search bar that scans every sheet at once can save hours of time.
This guide explains two practical ways to build a global search bar in Google Sheets:
- Formula-based method (no coding required – ideal for 5–20 sheets)
- Apps Script method (automatic and scalable – perfect for 20+ sheets or frequent use)
Both approaches create a dedicated “Search Dashboard” sheet where you type a keyword (e.g., “hookah flavor” or a product code), and matching rows appear instantly with context like the original sheet name.
Why You Need This
- Google Sheets doesn’t have a native “search all tabs” feature beyond basic Find & Replace.
- Manual searching across tabs is slow and error-prone.
- A custom search bar makes your spreadsheet feel like a mini-database: fast, user-friendly, and powerful for teams or personal use.
Method 1: Formula-Based Global Search (No Code – Quick Setup)
This works best when you have fewer sheets and similar data structure across tabs (e.g., same columns like Product, Price, Quantity).
Step 1: Create a Dedicated Search Sheet
- In your spreadsheet, add a new sheet and name it Search Dashboard (or “Global Search”).
Step 2: Set Up the Search Box
- In cell A1: Type “Search Term” (as a label).
- In cell B1: This is where you’ll type your keyword (leave it blank for now).
Step 3: Combine Data from All Sheets Using Array Literal In cell A3 (or wherever you want results to start), enter this formula to stack data vertically:
text
=QUERY({ Sheet1!A:Z; Sheet2!A:Z; Sheet3!A:Z; 'Task List'!A:Z; // Use single quotes if sheet name has spaces // Add every sheet here, separated by semicolons (;)}, "select * where Col1 is not null", 1)
- Replace Sheet1, Sheet2, etc., with your actual sheet names.
- A:Z assumes data spans columns A to Z – adjust if needed (e.g., A:AA).
- The QUERY wraps it to remove empty rows and keep headers.
Step 4: Add the Dynamic Search Filter In cell A5 (below the combined data), use this improved QUERY version for case-insensitive, partial-match search across columns:
text
=IF(B1="", "Enter a keyword in B1 to search all sheets", QUERY( {Sheet1!A:Z; Sheet2!A:Z; Sheet3!A:Z; ...}, // Same combined array as above "select * where lower(Col1) contains '"&LOWER(B1)&"' or lower(Col2) contains '"&LOWER(B1)&"' or lower(Col3) contains '"&LOWER(B1)&"' // Add more 'or lower(ColX) contains ...' for each column you want searchable ", 1))
- Col1 = Column A, Col2 = B, etc.
- This searches all mentioned columns for your keyword (partial matches like “flav” finds “flavor”).
- Type in B1 → results update live.
Pros & Cons
- Pros: Zero coding, instant updates, no permissions needed.
- Cons: Formula gets very long with 20+ sheets → becomes hard to maintain.
Method 2: Apps Script – Automatic Search Across Unlimited Sheets (Recommended for Large Workbooks)
When you have many tabs, manually listing them in formulas is impractical. Use Google Apps Script to auto-scan every sheet.
Step 1: Open Apps Script
- In your Google Sheet → Extensions > Apps Script.
Step 2: Paste This Custom Function Delete any default code and paste:
JavaScript
function GLOBAL_SEARCH(searchTerm) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheets = ss.getSheets(); var results = []; sheets.forEach(function(sheet) { var name = sheet.getName(); if (name === "Search Dashboard") return; // Ignore the search sheet itself var data = sheet.getDataRange().getValues(); for (var i = 1; i < data.length; i++) { // Skip header row var row = data[i]; var rowText = row.join(" ").toLowerCase(); if (rowText.includes(searchTerm.toLowerCase())) { var resultRow = [name].concat(row); // Add sheet name as first column results.push(resultRow); } } }); if (results.length === 0) { return [["No results found for: " + searchTerm]]; } // Add header row for clarity var headers = ["From Sheet"].concat(sheets[0].getRange(1,1,1,sheets[0].getLastColumn()).getValues()[0]); results.unshift(headers); return results;}
- What it does: Loops through every sheet (except Search Dashboard), checks if any cell in the row contains your keyword (case-insensitive), and returns the full row + sheet name.
Step 3: Use It in Your Search Dashboard Sheet
- A1: “Search Term”
- B1: Type your keyword here.
- In A3:
text
=IF(B1="", "Type a keyword above to search the entire workbook", GLOBAL_SEARCH(B1))
Step 4: Authorize & Test
- First time: Google will ask for permissions → Allow (it’s your own script).
- Type in B1 (e.g., a product name) → matching rows appear with the source sheet name in column A.
Pros & Cons
- Pros: Handles unlimited sheets automatically, fast for most use cases, easy to customize (e.g., search only specific columns).
- Cons: Requires one-time authorization; very large spreadsheets (>100k rows total) may need optimization.
Tips & Enhancements
- Multiple keywords: Type “flavor black” – the script searches the whole row.
- Exact column search: Modify the script to check only certain columns.
- Performance: For millions of rows, consider limiting to active sheets or using createTextFinder() for faster text search.
- Alternative built-in: For quick one-off searches, use Edit > Find and replace > Search: All sheets (but it doesn’t return results in a table like this).
This turns your Google Sheet into a powerful, searchable database without external tools. Try the formula method first if your workbook is small – upgrade to Apps Script as it grows.
Have questions or need tweaks (e.g., search only certain columns/sheets)? Drop a comment or share more details!
Leave a comment