Excel Automation using Google Distance API

Automated, real-time distance and travel-time calculation in Excel using Google Distance Matrix API and VBA.

Overview

This project automates distance and travel-time calculations inside Excel using the Google Distance Matrix API.

Instead of manually checking routes on Google Maps, users can enter source and destination addresses directly in Excel, and the sheet automatically fetches distance and duration using VBA. All selectable addresses are stored in a master sheet, and user can select them via dropdowns to calculate distance and driving duration between. By default, duration is for driving under no-traffic(optimistic) model. User can be giving options to change driving mode to “driving, biking, walking or public transport”, and traffic mode as “worst case, avg case, optimistic”.


Demo (Video)


Excel Interface

The Excel sheet allows users to input addresses via dropdowns and instantly get results.

Excel Distance Calculation Preview


VBA Automation Logic

The VBA script:

VBA Code for Google Distance API


Tech Stack


Key Learnings


Need something similar?

I help startups, agencies, and small remote teams automate workflows, improve reporting, and build internal tools around real operational problems.

If this project looks close to what your team needs, feel free to reach out and I can suggest a practical approach.

View services →

Contact me →