Google Maps Distance & Duration Calculator - Google Sheets, Build Apps Script Function - Part 14

  Рет қаралды 104,937

Learn Google Sheets & Excel Spreadsheets

Learn Google Sheets & Excel Spreadsheets

Күн бұрын

Пікірлер: 165
@Ofer.Sheinberg
@Ofer.Sheinberg 3 жыл бұрын
The fact that you let us in through your thought process, including caveats and being puzzled over unexpected results and figuring them out, rather than simply presenting a flawless step-by-step go-through without any glitches at all is priceless and has immense, inequivalent value in itself, way beyond the direct defined goal of the task at hand for itself. Kudos a million.
@santiagodonald9170
@santiagodonald9170 3 жыл бұрын
I know I'm kinda randomly asking but do anyone know a good website to watch new series online ?
@santiagodonald9170
@santiagodonald9170 3 жыл бұрын
@Garrett Mateo thanks, I went there and it seems like they got a lot of movies there :D Appreciate it !!
@garrettmateo3653
@garrettmateo3653 3 жыл бұрын
@Santiago Donald Glad I could help :D
@thisdudeandhisguitar
@thisdudeandhisguitar 5 жыл бұрын
Incredibly helpful! I used this and build an simple for loop to get directions to a big number of routes (did over 2000 routes the other day). For me this piece of code worked fine. Keep in mind that my company uses G-suite, which is why I haven’t run into any daily limits for this function. *note that I placed the origin in column C, the end in column D and set the values of the calculation in column E function googleMaps() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("YOUR_SHEET_NAME"); var lr = sheet.getLastRow(); var lc = sheet.getLastColumn(); var range = sheet.getRange(2, 3, lr-1, lc); //The first origin address was in the second row, third column. var values = range.getValues(); for (var i = 0; i < values.length; ++i) { var row = values[i]; var start = row[0]; var end = row[1]; var mapObj = Maps.newDirectionFinder(); mapObj.setOrigin(start); mapObj.setDestination(end); var directions = mapObj.getDirections(); var getTheLeg = directions["routes"][0]["legs"][0]; var meters = getTheLeg["distance"]["value"]; var km = meters / 1000; sheet.getRange(2 + i, 5).setValue(km); //this sets the outcome in column E, startin in the second row SpreadsheetApp.flush(); } }
@phunghm
@phunghm 2 жыл бұрын
Really no limit bro? I am using API called from Excel VBA and stuck over 100,000 requests per day.
@TheMKTube
@TheMKTube 2 жыл бұрын
This was amazing and 4 years later today it still works like a charm! Thank you saved me a ton of time! I ran it on 400 addresses and it worked well. I wish there was an easy way to make it return the shortest distance specifically because now Google serves the shortest trip time instead if I use the same code as in the video
@IceXiao
@IceXiao 4 жыл бұрын
Hey man. You've probably saved my life. Lemme know when you are in Toronto Ontario Canada, imma buy you a beer.
@ExcelGoogleSheets
@ExcelGoogleSheets 4 жыл бұрын
Cheers!
@jrr7031
@jrr7031 4 жыл бұрын
This is exactly what I needed!!!!! I will keep you posted and if what im doing takes off.....except SOME kinda payment. Not even playin.
@danielhaas8305
@danielhaas8305 5 жыл бұрын
Could you share the coode for copy paste in the description or as Link to a textfile? Would be great
@Praetorian269
@Praetorian269 6 жыл бұрын
I followed the video and learned how to create the function on my own using your step by step instructions. This video was exactly what I was looking for. Thank you so much!
@sgtballzack
@sgtballzack 6 жыл бұрын
Now limited on number of runs :-(
@johnkincaide7059
@johnkincaide7059 4 жыл бұрын
We do logistics costs every day! This is a lifesaver. Ditto to Ice Xiao comment below, when you are driving up to Toronto from the US, stop in Buffalo NY and I'll buy you a beer too and some original Buffalo chicken wings!
@skedouch335
@skedouch335 4 жыл бұрын
For those who it did not work, try to input : =GOOGLEMAPS(A1;A2;"miles") instead of , put ; I don't know why but it worked for me !
@ExcelGoogleSheets
@ExcelGoogleSheets 4 жыл бұрын
kzbin.info/www/bejne/opvZc2WXp6imhLM
@cw6842
@cw6842 6 жыл бұрын
Thank you so much!! Amazing. I thought the troubleshooting was going to be annoying, but I actually learnt a lot. Awesome.
@aijazahmed5256
@aijazahmed5256 6 жыл бұрын
Hi, is there anyway i can add waypoints in the route? So "start Address", "waypoint1", "waypoint2" and "end Address". Thank you!
@danielhaas8305
@danielhaas8305 5 жыл бұрын
Would love to see that function too!
@ukaszse3943
@ukaszse3943 5 жыл бұрын
Did You get answer ?
@dewaynewest7756
@dewaynewest7756 4 жыл бұрын
I'd love to know how to add stops...
@Scott-sm9nm
@Scott-sm9nm 7 жыл бұрын
Excellent step by step example. Thanks
@Sxeymaxzma
@Sxeymaxzma 6 жыл бұрын
Thanks for posting the video it was really helpful . however i have a quick questions.. how would go about getting distance for 4points. for example from a to b , b to c and c back to a ?thanks in advance.
@plescanmarius8221
@plescanmarius8221 6 жыл бұрын
Great hands on tutorial, very useful. Many thanks.
@eljermeto
@eljermeto Жыл бұрын
Great video, I learned a lot
@meilingyuson7227
@meilingyuson7227 3 жыл бұрын
It's been helpful and I was wondering do have video that has more than 2 direction. Thank you
@ariwahyunugroho
@ariwahyunugroho Жыл бұрын
Hai Sir, this tutorial free for a large amount of data? or is there a limit? Thank You
@vincenunnelly4297
@vincenunnelly4297 6 жыл бұрын
Im running into the issue where it works once, and then as I try another line, I get the error message "TypeError: Cannot read property "legs" from undefined. (line 11)." Any ideas on how to fix? I tried changing the calculation method per Nick below and error is not fixed
@bethanycharon797
@bethanycharon797 5 жыл бұрын
I'm having this same issue.
@RMuliaina
@RMuliaina 5 жыл бұрын
any update on this?
@dewaynewest7756
@dewaynewest7756 4 жыл бұрын
I had that issue because I was trying to run the function with a missing argument. One of my cells on the spreadsheet was empty. I was referencing the wrong column with my start point variable. I'm also a newbie. Hope this helps somebody.
@dewaynewest7756
@dewaynewest7756 4 жыл бұрын
Also, I use lat and long for starting point, and an address for destination. Appsheet allows me to use their here() function to get my lat and long w/o using my geo call.....
@mikezaring1365
@mikezaring1365 6 жыл бұрын
Dude, this was so freaking helpful! Thank you so much!
@nathanmarchant2718
@nathanmarchant2718 5 жыл бұрын
I have never done anything like this before, but my company is doing 100's of routes a day and this would make my life so much easier...is is able to be copy and pasted?
@ssoppe54
@ssoppe54 3 жыл бұрын
Hi, how to modify the script to ensure that the shortest route in distance and not in time is taken? Thank you
@phanhoangkhanh761
@phanhoangkhanh761 2 жыл бұрын
Thank you so much from viet nam
@ezrapetra9084
@ezrapetra9084 4 жыл бұрын
Thank You fro your tutorial. Its Help me alot.. Is there any way how to choose two-wheeler mode in maps on DirectionFinder? my region is Indonesia
@matussensel3806
@matussensel3806 5 жыл бұрын
Cool, thank you for this video! It works perfectly for me!
@sakshamgoyal08
@sakshamgoyal08 5 жыл бұрын
Hi Thanks for the video! The route it selects is the shortest by time. However I want the route with the shortest distance. How can I program it like that?
@ssoppe54
@ssoppe54 3 жыл бұрын
Up
@giannipellecchia340
@giannipellecchia340 2 жыл бұрын
Hi its posible get the current time to on a specific place?
@pqrisxpearl
@pqrisxpearl 6 жыл бұрын
Hey great video. the trial and error method was maddening. then actually started learning to debug. so silver lining for sure. getting error cant get the legs.... how to fix?
@LoicHamouda
@LoicHamouda 5 жыл бұрын
Very helpful tutorial ! Do you know how change the travel mode by bus or bike?
@Rahinser
@Rahinser 5 жыл бұрын
If you still need that info you can change the mode in the DirectionFinder objet like so: mapObj.setMode(Map.DirectionFinder.Mode.WALKING) you can set it to BICYLING/TRANSIT/DRIVING/WALKING
@Bram.A
@Bram.A 5 жыл бұрын
@@Rahinser Thanks for the start man! however, mapObj.setMode(Maps.DirectionFinder.mode.WALKING); gives me "TypeError: Cannot read property "WALKING" from undefined. (line 15, file "Code")" any help on writing walking differently?
@עמירצין
@עמירצין 4 жыл бұрын
Hello I see many people here are looking for a way to add a google map api key in order to avoid the daily quota. Any help would be mostly appreciated. Thanks
@InsideMyWall
@InsideMyWall 4 жыл бұрын
I want to create a google form where I can extract the coordinates of the photo uploaded by user considering a construction project having several site location. In order to track progress by photo documentation.
@nightwalker5727
@nightwalker5727 6 жыл бұрын
Hi, Nice tutorial. I liked the whole trial n error method of explaining.. However, let’s say we have got a list of addresses and we need to calculate the distances between them, in a matrix form. So column A1-A1000 would have one list and Row B1-BBZ1 will have one. Now if your are supposed to calculate the distance using the same set of codes, do you just need to change the inputs from a specified cell to a range or something else? Will this same code work in excel, the way I just explained? Any limits to daily number of iterations? Much thanks!
@ExcelGoogleSheets
@ExcelGoogleSheets 6 жыл бұрын
Yes, there are limits. Depends on your GSuite account level you'll have different limits. With regular google account I think it's 50 or 100 calls per day or something like that. Not sure exactly how many it is, but not too many. This code will not work in Excel. You'll need to use Google API or Bing API and connect with VBA code to pull the data, so it's very different in case of Excel.
@payamrostami5340
@payamrostami5340 5 жыл бұрын
I Know that the distance is constant but I want to know that Is the duration a real time approximation? or is just calculated once for each pair of origin, destination??
@restbony8835
@restbony8835 3 жыл бұрын
How to make these made functions work with arrayformula. It seems that it doesn't expand the formula throughout the selected cells or how to make it work with the code that have triggers on change and write distance value to cell. Please help. Thanks!
@mario17-t34
@mario17-t34 10 ай бұрын
Sorry, can it work to find direct distance ? (vs travel distance)
@mvgiugni65
@mvgiugni65 3 жыл бұрын
Hi There. Excellent tutorial. Is there a way to collect the Phone number, Email, and Address of a given registered company on Google Maps using a variation of this script?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
I haven't tried it with places but you can test if it returns the info in the object then yes. Otherwise you'll need to hook into Placed API
@mvgiugni65
@mvgiugni65 3 жыл бұрын
@@ExcelGoogleSheets I have no ideia how to try to get this data from the APIs. Looking into documentation it does not explain nothing similar to my needs. Do you have any tutorial showing how to work with Sheets and Placed API? If so, could you please share the KZbin link?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
@@mvgiugni65 I just checked the docs, it doesn't support places, so you would have to use Place API developers.google.com/maps/documentation/places/web-service/search-find-place
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
I don't have a video on this.
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
Note that Place API is not a free service.
@Mike-qn1nm
@Mike-qn1nm 5 жыл бұрын
Possible to find as the crow flies distance vs drive route as depicted?
@juanrangel1599
@juanrangel1599 6 жыл бұрын
Is there any way to get drive time based on Traffic Conditions of a certain part of the day. I live in Los Angeles and traffic hour makes a huge difference. I would really appreciate if you could help me with that.
@keencrew6593
@keencrew6593 3 жыл бұрын
Hey man, this looks amazing - Do you have a website where I can copy this code from?
@classicalcats6hydrocephalu363
@classicalcats6hydrocephalu363 4 жыл бұрын
I am building a travel route list using MyMaps...and it gives route, but no times or distance...why not? Why isn't that built in? Is the only way to do what you're doing?
@ronyjoseph529
@ronyjoseph529 5 жыл бұрын
@ Learn Google Spreadsheets Is it possible to get distance from the link of the location?
@amaljose90
@amaljose90 5 жыл бұрын
Nice one. Thank you so much. How can we calculate "duration" in real time basis, not just the average time? In other words, how can we obtain actual duration of journey using the departure time from the origin??? Can you paste the code for the same pls?
@gaaraxpo
@gaaraxpo 5 жыл бұрын
hey, you forgot to put ""var" before the assignment of the start_address and end_address, but why it still worked?
@carlos_kay
@carlos_kay 4 жыл бұрын
I wondered too but it's because they're already defined in the function, within the brackets.
@digitalmarketinggateways5374
@digitalmarketinggateways5374 Жыл бұрын
What about measuring the distance between two zip codes?
@mayakerem1016
@mayakerem1016 5 жыл бұрын
Great tutorial! thank you! Only when I want to test the function and use an actual input from my spreadsheet I get and error "Action not allowed (line 9)." and it refers to " var directions = mapObj.getDirections(); " Any advice?
@dominictenorio4743
@dominictenorio4743 5 жыл бұрын
Maya: Been trying to work though the same issue, but no luck. I though it had something to do with clientID & key credentials but every example I have tried fails.
@jacobngrundfos3194
@jacobngrundfos3194 5 жыл бұрын
I have the same problem. Can't solve it.
@MrAdamRG
@MrAdamRG 4 жыл бұрын
Jacob N Grundfos Any luck?
@thepastileros56
@thepastileros56 4 жыл бұрын
Hey man, I am just wondering on how to make these made functions work with arrayformula. It seems that it doesn't expand the formula throughout the selected cells. Please help. Thanks!
@robviously-rob0ts
@robviously-rob0ts 5 жыл бұрын
Thank you for the script! May I ask you how I could get it to avoid tolls?
@tonyc8925
@tonyc8925 5 жыл бұрын
var directionFinder = Maps.newDirectionFinder().setAvoid(Maps.DirectionFinder.Avoid.TOLLS);
@angu3272
@angu3272 5 жыл бұрын
great video! I have to make a list for mileage. I always have to take the shortest route and not the fastest. how can I enter this in the script, that he always takes the shortest distance. Thanks for your help
@siddhantmungekar5916
@siddhantmungekar5916 2 жыл бұрын
why can you paste the final code in the description or a attachment if you wanted us to make so much rectification
@KuldeepSingh-pl7rv
@KuldeepSingh-pl7rv 3 жыл бұрын
7:59 is where you reveal the easiest formula to get distance and direction :D:D:D
@yujiexue6804
@yujiexue6804 5 жыл бұрын
Are you able to add an autocomplete address function?
@ahmadnafeesmohiuddin6461
@ahmadnafeesmohiuddin6461 2 жыл бұрын
Dear Sir, Can you please direct us on how to create a heat map layer with sheet and map with different data
@IsaacTannerDempsey
@IsaacTannerDempsey 5 жыл бұрын
Hi Love this video! Can we have another tut on how to lookup postcode and output suburbs
@dreamerxxxc
@dreamerxxxc 5 жыл бұрын
myrouteonline is great price enter address and postal codes will be found quick.
@pken9147
@pken9147 6 жыл бұрын
Good day - so i followed your video, reviewed several times, before and after. I get strange results - nothing. no error, no calculated distance, nothing. I do not have a billable account for API calls to google, so i am wondering if that is the problem? I see you have not responded to anyone since about 10 months ago, so not hopeful that 1. i am able to do this, 2. that you are going to even tell me its not going to work without the billable google api call. Great video by the way - very easy to follow, just sucks that google is more interested in my money.
@ExcelGoogleSheets
@ExcelGoogleSheets 6 жыл бұрын
At the time of making this video you could just use it with a regular account. Haven't had to use this since, so I'm not sure.
@brormagnussand1446
@brormagnussand1446 6 жыл бұрын
Could you please update the code with API-key?
@AC-xo5jw
@AC-xo5jw 6 жыл бұрын
Great video! however, Google recently introduced the API key in Google Maps Distance matrix. How do I incorporate this into Apps script? thanks!
@dreamerxxxc
@dreamerxxxc 4 жыл бұрын
Your google account linked to email get API account should automatically work
@shreyansmishra2910
@shreyansmishra2910 3 жыл бұрын
What is the limit of distances that we can find in a day ?
@David-eb1hh
@David-eb1hh 2 жыл бұрын
I wish this would work for me but app script does not have the view log function so i cannot find my error
@siddheshgawali7764
@siddheshgawali7764 7 жыл бұрын
can you make a video to obtain the directions of .... to set a var to get the directions in it....just right or left will do.....pls
@Unknown13331
@Unknown13331 3 жыл бұрын
Plz help i need your help, i have a video of something moving and i want to find its speed but i can't because the sky is so big to measure with the frame i have, i have the time it taken it to travel from point A to point B but not the distance, can u please help me?
@muammartapang4818
@muammartapang4818 6 жыл бұрын
Hi Nice Video, I was able to run this but I'm getting miscalculated time. The distance was correct but the value is not correct. It shows all the routes around more or less 2hours and 28mins but I'm getting only 1hour and 30min only on the first route. Whats the idea about this. Already checked this with the Logger.log and same result.
@TRiiGGAK4786
@TRiiGGAK4786 2 жыл бұрын
possibly it's using a walk function instead of drive, test it with the same routes on gmaps and try different transport methods and see if the time matches your unexpected output
@leicestersquarebob840
@leicestersquarebob840 5 жыл бұрын
what would you do if you want cycling distance or walking distance?
@chrisruzicka2309
@chrisruzicka2309 5 жыл бұрын
Hi, how do I have to change the script to get the walking destance?
@elsgrupovino7314
@elsgrupovino7314 4 жыл бұрын
can you convert the URL location to Coordinates?
@josesanz3293
@josesanz3293 6 жыл бұрын
can you change the travel mode?
@IJsbaanLeuven_official
@IJsbaanLeuven_official 5 жыл бұрын
see my comment above :-) Good luck !
@zhero86
@zhero86 6 жыл бұрын
THAAAAAAAAAANKSSS!!! Love it!
@Bayesboss
@Bayesboss 7 жыл бұрын
Hello, I built the code exactly how it's in the video but I'm getting the following error: "UrlFetch failed because too much traffic is being sent to the specified URL" to the line "var directions = mapObj.getDirections();". Could you please help me fix it? I'm new to javascript and google APIs
@ExcelGoogleSheets
@ExcelGoogleSheets 7 жыл бұрын
How many addresses do you have? It seems like you may have reached your daily quota for UrlFetch.
@Bayesboss
@Bayesboss 7 жыл бұрын
I only have 2 addresses (start and end addresses) as per your tutorial
@ExcelGoogleSheets
@ExcelGoogleSheets 7 жыл бұрын
the limit is per account, so if you have other functions that fetch external data through UrlFetch it will affect the limit as well. Also make sure those addresses are valid.
@Bayesboss
@Bayesboss 7 жыл бұрын
I registered for the Google account yesterday and don't have any other functions enabled other than this tutorial. Thank you anyway.
@ExcelGoogleSheets
@ExcelGoogleSheets 7 жыл бұрын
maybe share the spreadsheet so we can see what's happening?
@MuhammadIbrahim-zc1vx
@MuhammadIbrahim-zc1vx 4 жыл бұрын
It doesn't work with two countries e.g. USA, Bangladesh I get the below error TypeError: Cannot read property 'legs' of undefined (line 16).
@ExcelGoogleSheets
@ExcelGoogleSheets 4 жыл бұрын
I haven't really tested it with other countries. You'll need to check the JSON response and see what you get.
@nitishkalyanpad9240
@nitishkalyanpad9240 6 жыл бұрын
I want to find distances for thousand pairs of origin and destination and it is giving me an error "you have exceeded your daily limit". Please tell me a way by which i can include my API key in the script
@ericostring8182
@ericostring8182 6 жыл бұрын
I'v got the same problem..
@ExcelGoogleSheets
@ExcelGoogleSheets 6 жыл бұрын
I haven't actually tested this but I think this should work GOOGLEMAPS(A2,B2,"miles","clientId","signingKey") Using the function below in your script editor /** * Get Distance between 2 different addresses. * @param start_address Address as string Ex. "300 N LaSalles St, Chicago, IL" * @param end_address Address as string Ex. "900 N LaSalles St, Chicago, IL" * @param return_type Return type as string Ex. "miles" or "kilometers" or "minutes" or "hours" * @customfunction */ function GOOGLEMAPS(start_address,end_address,return_type,clientId, signingKey) { // www.chicagocomputerclasses.com/ // Nov 2017 // improvements needed Maps.setAuthentication(clientId, signingKey); var mapObj = Maps.newDirectionFinder(); mapObj.setOrigin(start_address); mapObj.setDestination(end_address); var directions = mapObj.getDirections(); var getTheLeg = directions["routes"][0]["legs"][0]; var meters = getTheLeg["distance"]["value"]; switch(return_type){ case "miles": return meters * 0.000621371; break; case "minutes": // get duration in seconds var duration = getTheLeg["duration"]["value"]; //convert to minutes and return return duration / 60; break; case "hours": // get duration in seconds var duration = getTheLeg["duration"]["value"]; //convert to hours and return return duration / 60 / 60; break; case "kilometers": return meters / 1000; break; default: return "Error: Wrong Unit Type"; } }
@ruwangifernando3416
@ruwangifernando3416 6 жыл бұрын
Hi Nithish were you able to find a solution for a large number of origin and destination pairs
@danielhaas8305
@danielhaas8305 5 жыл бұрын
@@ExcelGoogleSheets For this to make it work one would have to purchase a premium plan right? Cant figure out where to get my client ID. API key would be no problem...
@viktorhasson5899
@viktorhasson5899 4 жыл бұрын
How can I get the link to Google Maps? Only via API?
@mikewurlitzer5217
@mikewurlitzer5217 6 жыл бұрын
Like a few others have mentioned I am getting a "TypeError: Cannot read property "legs" from undefined. (line 6)". Line 6 looks like this: var getTheLeg = directions["routes"][0]["legs"][0]; The code preceding this: function GOOGLEMAPS(StartAddress, EndAddress, return_type) { var mapObj = Maps.newDirectionFinder(); mapObj.setOrigin(StartAddress); mapObj.setDestination(EndAddress); var directions = mapObj.getDirections(); var getTheLeg = directions["routes"][0]["legs"][0]; var meters = getTheLeg["distance"]["value"]; I have made sure the addresses are correct and using the Logger.log function I can get the "directions" to log and I see the: "legs=[{duration={text=18 mins, value=1082}" and a bit further I see "distance={text=6.0 mi, value=9617}"
@RMuliaina
@RMuliaina 5 жыл бұрын
Check for Tolls
@itsdakku
@itsdakku 2 жыл бұрын
how can I add multiple points?
@VacatedMemo117
@VacatedMemo117 5 жыл бұрын
thank you!!!
@ankitathakur313
@ankitathakur313 4 жыл бұрын
please give me the solution of this error it is urgent TypeError: Cannot read property 'distance' of undefined (line 53, file "Code"
@VIDEOxNICK
@VIDEOxNICK 7 жыл бұрын
I'm getting an Error: "TypeError: Cannot read property "legs" from undefined. (line 16).
@VIDEOxNICK
@VIDEOxNICK 7 жыл бұрын
could it have something to do with how the address is formatted in the cell? for example, I've noticed problems when I input address like "Street Address, City, State Abbreviation"
@netboy1102
@netboy1102 6 жыл бұрын
The same here, but Sometimes it works, Dont know why it didn't work anymore after several times testing.
@VIDEOxNICK
@VIDEOxNICK 6 жыл бұрын
Hey, I found a work around to the problem.. Go in to your spreadsheet where you're using the custom function. under 'File' select 'Spreadsheet settings'. Then select the 'calculations' tab. You should see an option to turn 'on' the 'Iterative calculation'. I have my max number of iterations set to '10' and the threshold set to '.05'. Making that adjustment did the trick for me. I'm not 100% sure of how this limits the functionality of other formulas, but it certainly helps with this one.
@VIDEOxNICK
@VIDEOxNICK 6 жыл бұрын
Also, I'm still not 100% confident in using the custom formula still, because I've run into a couple of errors here and there with it.. Most likely because of the way in which the address, state, zip, is parsed together, but it's definitely better with the work around. It'd be great if there was some kind of add-on that was more consistent.
@netboy1102
@netboy1102 6 жыл бұрын
Videos by Nick Thanx, I will try.
@entertain_all2250
@entertain_all2250 5 жыл бұрын
How can i calculate google distance between two points using latitude and longitude
@derekherzog1569
@derekherzog1569 5 жыл бұрын
in the mapobj.getdirections method there's a version that uses lat/long points instead of addresses
@StrayFire
@StrayFire 5 жыл бұрын
now I need a script (button) that does this for a large column, but sleeps between every row
@noahverhine186
@noahverhine186 6 жыл бұрын
I am trying to use this code to help get distances from events to teams. I am getting an Error every time I try to use it. I am getting the service invoked to many times for one day. I am unsure if i am doing something wrong can anyone help me?
@shaksayon9019
@shaksayon9019 5 жыл бұрын
Hi @Noah Verhine, any update on this? I am also getting the same error. :(
@savannahurst3334
@savannahurst3334 7 жыл бұрын
How do i get the maps object in appscript?
@ExcelGoogleSheets
@ExcelGoogleSheets 7 жыл бұрын
It should be in there by default.
@djdisasterjames
@djdisasterjames 4 жыл бұрын
@@ExcelGoogleSheets It's not there for me... Searching Google doesn't help... :(
@Sxeymaxzma
@Sxeymaxzma 6 жыл бұрын
hi i keep getting this error message "TypeError: Cannot read property "legs" from undefined. (line 19)." can you please help? thanks
@NoProbsMedia
@NoProbsMedia 6 жыл бұрын
Did you ever get a reply that fixed this issue? I have the same problem!
@Sxeymaxzma
@Sxeymaxzma 6 жыл бұрын
no i didnt.
@RMuliaina
@RMuliaina 5 жыл бұрын
@@NoProbsMedia Tolls were the issue for me
@whocares6901
@whocares6901 5 жыл бұрын
Hello moderator. Can you build me a custom sheet along these lines? I'll pay you.
@toufik3102
@toufik3102 2 жыл бұрын
the fonction plz
@toufik3102
@toufik3102 2 жыл бұрын
the code plz
@manjunathforu
@manjunathforu 4 жыл бұрын
Lat long to Zip code script please
@stefannikolic6365
@stefannikolic6365 4 жыл бұрын
You need to host your code to some other place your website has an UI bug it does not copy the complete code that is why most of the people including myself had issues with the script. Copy it from the comments: /** * Get Distance between 2 different addresses. * @param start_address Address as string Ex. "300 N LaSalles St, Chicago, IL" * @param end_address Address as string Ex. "900 N LaSalles St, Chicago, IL" * @param return_type Return type as string Ex. "miles" or "kilometers" or "minutes" or "hours" * @customfunction */ function GOOGLEMAPS(start_address,end_address,return_type) { // www.chicagocomputerclasses.com/ // Nov 2017 // improvements needed var mapObj = Maps.newDirectionFinder(); mapObj.setOrigin(start_address); mapObj.setDestination(end_address); var directions = mapObj.getDirections(); var getTheLeg = directions["routes"][0]["legs"][0]; var meters = getTheLeg["distance"]["value"]; switch(return_type){ case "miles": return meters * 0.000621371; break; case "minutes": // get duration in seconds var duration = getTheLeg["duration"]["value"]; //convert to minutes and return return duration / 60; break; case "hours": // get duration in seconds var duration = getTheLeg["duration"]["value"]; //convert to hours and return return duration / 60 / 60; break; case "kilometers": return meters / 1000; break; default: return "Error: Wrong Unit Type"; } }
@ExcelGoogleSheets
@ExcelGoogleSheets 4 жыл бұрын
Thanks for letting me know,
@dewaynewest7756
@dewaynewest7756 4 жыл бұрын
I'd love to be able to call on a custom route based on my spreadsheet
@srikanthchowdary752
@srikanthchowdary752 3 жыл бұрын
send the script Please
@BigVigo
@BigVigo 4 жыл бұрын
Bruh
@MassiveSwordAndCards
@MassiveSwordAndCards 5 жыл бұрын
Doesn't work. Just returns "Wrong unit type" no matter what addresses and return type I enter. Junk script.
@ConeyConstructionCoLLCDallas
@ConeyConstructionCoLLCDallas 5 жыл бұрын
Works fine! You're doing something wrong!
@RodolfoFedrizzi_HiTz
@RodolfoFedrizzi_HiTz 2 жыл бұрын
I did the tutorial step by step and still not working, the function =GOOGLEMAPS ends up in error. Is there any place that I can find the project to compare and see what is different? Exception: Invalid argument: origin GOOGLEMAPS @
@نیلوفرقزوینی
@نیلوفرقزوینی 2 жыл бұрын
just like me...Unfortunately, I could not find a solution either.
Google Apps Script - Google Drive Tutorial, Files, Folders, Copy Files, DriveApp, Iterator - Part 15
29:31
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 134 М.
JavaScript Objects - Iterate Through Object Keys and Values - Google Sheets Apps Script - Part 13
35:10
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 63 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
Google Sheets - Apps Script Google Calendar API  Integration Tutorial - Get Events - Part 10
30:52
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 126 М.
Google Sheets - Send Emails Using Apps Script JavaScript MailApp Tutorial - Part 12
36:10
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 249 М.
5 Excel Secrets You'll Be Embarrassed You Didn't Know
17:32
Excel Campus - Jon
Рет қаралды 292 М.
Convert Google Sheets into a REST API
14:10
Better Sheets
Рет қаралды 16 М.
Googlesheet Distance calculation
12:40
Taleb Bekkali
Рет қаралды 7 М.
Excel Macros & VBA - Tutorial for Beginners
50:20
Kevin Stratvert
Рет қаралды 1,3 МЛН
App Script Tutorial - Google Sheets - For Loops, Looping Through Cells, Variables, Comments - Part 2
24:17
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 229 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН