The IFTTT recipe fires off when an event starts. It sends the event info (including address) to a Google sheet, appending the event to the last row of the spreadsheet. Pretty much all of the appointments in my calendar are tax deductible but I go in and delete the occasional ones that are not deductible from the spreadsheet. You can also set up this IFTTT recipe to only fire off when you have a certain keyword in your event, which is useful if your calendar mixes deductible and non deductible. Simply append a word to your event title for the items that are deductible.
function distance(pointa,pointb) {
var randnumber = Math.random()*5000;
Utilities.sleep(randnumber);
Utilities.sleep(randnumber);
var directions = Maps.newDirectionFinder()
.setOrigin(pointa)
.setDestination(pointb)
.setMode(Maps.DirectionFinder.Mode.DRIVING)
.getDirections();
var route = directions.routes[0];
var txtA = route.legs[0].distance.value;
return txtA;
}
You will have to add a column that has the starting address for your drive. This is easiest to populate if you always start from the same address but you can always change each item individually. Unfortunately this system only works for round trips, though with a little effort you can adapt this for a separate starting and ending address.
You then add a column to the end that has this formula.
=distance($B2,$C2)/1609*2
$B2 and $C2 are the two cells containing the starting address that you add and the address of the event from Google Calendar. This formula computes the distance in yards, converts that to miles and then multiples by 2 to figure out the round trip.
=distance($B2,$C2)/1609*2
$B2 and $C2 are the two cells containing the starting address that you add and the address of the event from Google Calendar. This formula computes the distance in yards, converts that to miles and then multiples by 2 to figure out the round trip.
No comments:
Post a Comment