Gmail Mail Merge Google Sheets: Fix Blank First Names
If your Gmail mail merge from Google Sheets is producing emails that start with "Hi ," or "Dear ," the cause is almost always the spreadsheet, not the merge tool. Any cell that is empty, contains only a space, or holds a company name instead of a person gets pasted into the template exactly as it is. The fix is to stop merging on the raw name column and instead merge on a helper column that supplies a fallback such as "there" whenever the original cell is blank. One formula does it: =IF(TRIM(A2)="","there",TRIM(A2)). The rest of this article shows how to find the problem rows, build that column, handle the common variations (full names in one cell, dates showing as numbers, odd capitalization), and run a short pre-send check so nothing embarrassing goes out.
Why a Gmail mail merge from Google Sheets sends "Hi ,"
A mail merge is a simple substitution. The tool reads one row of your Sheet, replaces each placeholder in your draft with the value from the matching column, and sends. It does not know that FirstName is supposed to be a person's name, and it has no opinion about what should happen when the cell is empty. Most tools, whether that is Google Workspace's built-in mail merge, an Apps Script you found online, a Sheets add-on, or a Chrome extension like Zestmail that merges from a Google Sheets URL, insert whatever the cell contains. If the cell contains nothing, you get nothing, and the comma you typed after the placeholder is left stranded.
The blank cell is only the most obvious case. The same mechanism produces these:
- A cell with a single space looks empty but is not, so even tools that do offer a fallback option may not trigger it. You get "Hi ," with two spaces.
- A full name in the first-name column ("Hi Priya Raman,") because the list was exported from a CRM or a sign-up form with one name field.
- ALL CAPS or all lowercase ("Hi SAMUEL," or "Hi samuel,") from people typing quickly on a phone.
- Placeholder text from the source system, such as "N/A", "Unknown", "-" or "test".
- A company name where a person's name should be, because a generic address like info@ or hello@ was added to the list.
- Dates and prices rendered as raw values, so "your trial ends on {{EndDate}}" becomes "your trial ends on 46325" because Google Sheets stores dates as serial numbers.
Each of these is a data problem, and data problems are best solved where the data lives. Fixing the Sheet means every tool you ever point at it behaves correctly, and you can see exactly what will be sent before you send it.
Find the rows that will go wrong
Before writing formulas, find out how many rows are affected. Three quick ways in Google Sheets:
- Count the blanks. In an empty cell, type
=COUNTBLANK(A2:A)(replaceAwith your first-name column). If this says 0 but you still saw "Hi ,", you likely have cells with spaces rather than true blanks. Try=COUNTIF(A2:A," ")and=COUNTIF(A2:A,""). - Filter the column. Select the header row, choose Data › Create a filter, click the filter icon on the first-name column, and look at the list of values. Blanks appear at the top as "(Blanks)". Scroll the list for entries like "N/A", "-", single letters or company names.
- Flag suspicious entries. In a new column, use
=IF(OR(TRIM(A2)="",LEN(TRIM(A2))<2,ISNUMBER(SEARCH(" ",TRIM(A2)))),"check",""). This marks rows where the name is blank, is a single character, or contains a space (which usually means a full name landed in the first-name field). Sort by this column and review the "check" rows by hand.
For a list of a few hundred rows, the manual review usually takes five minutes and catches things no formula will, such as "Dr. Okafor" in the first-name field.
Build a fallback column in Google Sheets
Do not overwrite your original column. Add a new column, label it clearly (for example Greeting), and merge on that instead. Keeping the raw data means you can change your mind about the fallback wording later without losing information.
Basic fallback
In the first data row of the new column:
=IF(TRIM(A2)="","there",TRIM(A2))
TRIM strips leading and trailing spaces, so a cell containing only a space counts as empty. If the result is empty, the formula returns "there"; otherwise it returns the cleaned name. Drag the formula down or use =ARRAYFORMULA(IF(TRIM(A2:A)="","there",TRIM(A2:A))) in the first cell to fill the whole column at once.
"Hi there," is the usual choice because it reads naturally in English and does not pretend to know the person. Alternatives that work in specific contexts: "Hi" with no name at all (write the greeting so the comma is inside the formula, see below), the person's role ("Hi team"), or the company name if you have one in another column.
Put the whole greeting in the formula
If you want the no-name version to be plain "Hi," rather than "Hi there,", move the comma into the Sheet:
=IF(TRIM(A2)="","Hi,","Hi "&TRIM(A2)&",")
Then your template starts with {{Greeting}} on its own line, and there is no stray punctuation to worry about. This is the most robust approach because the template contains no assumptions about what the column holds.
Catch placeholder values
Extend the test to treat common junk as blank:
=IF(OR(TRIM(A2)="",LOWER(TRIM(A2))="n/a",LOWER(TRIM(A2))="unknown",TRIM(A2)="-"),"there",TRIM(A2))
Add whatever your particular source system produces.
Fix capitalization
PROPER() capitalizes the first letter of each word and lowercases the rest, turning "SAMUEL" into "Samuel". Be aware that it also changes "McKenzie" to "Mckenzie" and "DeShawn" to "Deshawn". A reasonable compromise is to apply it only when the cell is entirely upper or lower case:
=IF(OR(EXACT(A2,UPPER(A2)),EXACT(A2,LOWER(A2))),PROPER(A2),A2)
Wrap this inside the fallback formula, or put it in its own helper column and reference that.
Split a full name
If a column holds "Priya Raman" and you only want "Priya":
=IF(TRIM(B2)="","there",REGEXEXTRACT(TRIM(B2),"^\S+"))
REGEXEXTRACT with ^\S+ returns everything up to the first space. For single-word entries it returns the whole word. Check the results for names that start with a title ("Dr.", "Mr.") and for cultures where the family name comes first; a formula cannot know which convention a row follows, so the manual review from the previous section still matters.
Dates and numbers
Google Sheets passes the underlying value to many merge tools, not the formatted display. To be safe, convert explicitly:
=TEXT(D2,"d mmmm yyyy") → 24 October 2026
=TEXT(E2,"$#,##0.00") → $1,250.00
Merge on these text columns. Combine with a fallback if the date can be missing: =IF(D2="","soon",TEXT(D2,"d mmmm yyyy")).
Conditional sentences
Fallbacks are not only for greetings. If some rows have a company and some do not, build the whole sentence in the Sheet:
=IF(TRIM(C2)="","I noticed you signed up last week.","I noticed "&TRIM(C2)&" signed up last week.")
The template then contains {{OpeningLine}} and every recipient gets a sentence that reads correctly. This keeps the logic visible in one place instead of hidden in a tool's settings.
Three checks before you hit send
Fixing the data gets you most of the way. These checks catch the rest.
- Sort by the fallback column. Click the header of your
Greetingcolumn and sort A to Z. All the "there" rows group together; scan them to confirm they really have no usable name. Then sort Z to A and look at the top for anything odd, such as names beginning with symbols or numbers. Undo the sort afterward if row order matters to you. - Preview three rows, not one. Most merge tools show a preview of the first row. The first row is usually a clean one. Temporarily move a blank-name row, a full-name row and a row with a date to the top of the Sheet, preview each, then move them back. If your tool lets you choose which row to preview, use that instead.
- Send a test batch to yourself. Add two or three rows at the top of the Sheet with your own address (or Gmail aliases such as [email protected]), one with a normal name, one with an empty name cell, one with a date. Run the merge on just those rows, open them in Gmail, and read them on a phone as well as a desktop. Then delete the test rows and run the real send.
If you are using a free Google Workspace account with the built-in mail merge, Apps Script, or any add-on, these checks apply equally. The Sheet is doing the work; the tool is just reading it.
Where an extension fits
Zestmail is a Chrome extension for Gmail that includes mail merge from a Google Sheets URL, so the helper-column approach above works unchanged: build the Greeting column, paste the Sheet URL, and use that column in your draft. The reason to reach for it rather than a script is mainly what happens after sending. Zestmail adds open tracking to Gmail, showing whether and when each recipient opened the message, and it filters out your own opens and common bot opens so a test batch sent to yourself does not pollute the results. That makes it possible to compare, for instance, whether the "Hi there" rows are opened less often than the named rows, which is a useful signal for deciding how much effort to spend collecting first names. Open tracking is never exact (image blocking and privacy proxies such as Apple Mail Privacy Protection hide some opens), so treat it as a trend, not a count. The free plan covers up to 20 emails a day and adds a small "Sent with Zestmail" footer; the Pro plan removes that limit for $9 a month or $69 a year, with a 7-day trial. If you only merge occasionally and do not need to know who opened what, Google's own tools are enough and cost nothing.
Keep the list clean going forward
The blank-name problem returns every time a new export lands in the Sheet. Two habits prevent it:
- Make the first-name field required at the source. If people join your list through a Google Form, Typeform or a website form, mark the first-name field as required and label it "First name" rather than "Name". A single "Name" field is how full names end up in the wrong column.
- Keep the formulas in a template Sheet. Save a copy of your merge Sheet with the helper columns and no data. Each time you have a new list, paste the raw rows into the data columns and the fallback, capitalization and date formulas fill in automatically. Review the "check" column, run the three pre-send checks, and send.
The underlying rule is simple: a mail merge will faithfully send whatever is in the cell. Decide what each cell should contain for every possible case, encode that decision in a formula, and look at the edge cases before the recipients do.