Question

Finding closest zip code in Google sheet

  • 2 January 2023
  • 2 replies
  • 207 views

I'm looking to use a Google sheet as a database with multiple businesses' contact information. Based on the zip code input from a form (using Gravity Form), I want the sheet to look for the closest zip code and send an email.

I've tried using the lookup row function with Google sheet, but it won't trigger unless the zip code in the Google sheet is an exact match


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 4
Badge +7

Hey there @AndreM, As Troy is alluding to there isn’t a great way to do this in Zapier.   There is no way for Google Sheets to be able to compute the distance of Zip Code 1 vs Zip Code 2 and then pick the closest one.  

You would need some sort of a tremendously large reference table of all Zip Codes and their distances from one another to do a few different lookups and then perform the search of the Google Sheet.

Would your idea still work if you focused at the State level instead of the Zip Code level?  That may be a workaround if you needed to automate this through Zapier in some way if you would be able to modify your non-Zapier workflow.

Userlevel 7
Badge +14

Hi @AndreM 

Good question.

If you are trying to use a GSheet, then the value will need to exist as part of the lookup.

You’d need to map every Zip to it’s parent Zip.