Mitch's Gas Mileage Tracker v 0.5

This is my attempt to make tracking gas mileage with Lotus 1-2-3 a little
easier. I am not a Lotus expert and this is simply a spreadsheet database with
a couple of macros: one for adding a new record and one for graphing your
mileage. Thanks go to Tom Gibson of the HP Palmtop Paper for helping with the
macros and to Ray Larson for some helpful Lotus tips.

#include <standard_disclaimer.h>

The spreadsheet tracks a lot of data. If it's more than you need, just modify
it to suit your tastes. Be careful not to delete any rows in the 1-15 range as
the macros live out in the AA region of the spreadsheet in those rows.

The data that gets tracked:

Average cost per gallon - Takes an average of all the prices in Column F
starting at Row 17

Average miles per gallon - Takes an average of the gas mileages in Column I
starting at Row 17

Average miles per tank - Takes an average of the "trip odometer" miles in
Column J starting at Row 17. The value of this number will be less if you fill
up at varying tank levels. I usually wait until the needle is on "E", but I
have run out of gas, too.

Average gallons per fillup - Takes an average of the fuel quantities in Column
E starting at Row 17

Total miles traveled - Sums all the "trip odometer" miles in Column J starting
at Row 17

Total gallons burned - Sums all the fuel quantities in Column E starting at Row
17

Total spent on fuel - Sums all the fuel purchases in Column G starting at Row
17

Average monthly fuel cost - Takes the product of "Average miles per year" and
"Fuel cost per mile" and divides it by 12

Fuel cost per mile - Divides "Total miles traveled" into "Total spent on fuel"

Best fuel economy - Finds the maximum value for fuel mileage in Column I
starting at Row 17

Worst fuel economy - Finds the minimum value for fuel mileage in Column I
starting at Row 17

Average miles per day - Takes the maximum day value in Column A starting at Row
17, subtracts the minimum day value and then divides that number into the
"Total miles traveled"

Average miles per year - Takes the "Average miles per day" and multiplies it by
365

Average days between fillups - Takes the maximum day value in Column A starting
at Row 17, subtracts the minimum day value and then divides by the number of
fillups in the database.

The database is seeded with two fictitious records just to hold all the
formulas. Before using the database, you need to modify these two records with
your data. The date entry is done "Lotus style" so today (September 5, 1996) is
35313. Change the dates to agree with your last two fillups. Also, change the
station, city and state of your fillups; use F2 to edit these cells if you want
to keep the center formatting. Now enter the trip odometer of your first record
in J18. This value is normally figured automatically, but this is a seed record
and it needs a hard value to start from. Finally for the two records, enter
price per gallon (Column F), price (Column G) and odometer (Column H). These
will format correctly so just enter the numbers right in the cells. The rest of
the values will be figured for you. Save your work.

Now you're set to use the macros. The graphing macro won't be of much use until
you get some data entered, but the record entry macro will be used each time
you fill up.

What the macros do:

Alt-Q enters a new record. It starts by inserting a new row 17, enters the
current date and formats it correctly. It then copies the station, city and
state from your last fillup. I did this because I usually use the same station
and didn't want to re-type. I you're a traveler, you will want to modify the
macro so it will ask you for these values. Next, the macro asks you for the
price per gallon and the total price then takes these values and figures out
how many gallons you purchased. It then asks you for the odometer reading and
then figures out your gas mileage and the trip length. Finally, it returns to
A1.

Alt-A graphs your mileage. It gets an X range of all your fillup dates and
plots a Y range of all your gas mileages. It's just a little bell or whistle,
whichever you want to call it.

Tricky stuff:

I found that I didn't like to use Lotus spreadsheets unless they were easy to
access. Easiest for me is with an icon and a hot key in the Application
Manager. To do this, you need to be using keystuff. It's on my palmtop page if
you don't have it. Directions for installation are simple.

(My palmtop page is at http://w3.one.net/~hamm/palmtop.html)

To start the spreadsheet automatically:

Place the MILEAGE.WK1 in your default Lotus 1-2-3 directory

Place the KS.ICN file in the same directory where you have KS.COM.

In Application Manager, add a new application (F2) and call it MP&G. The "G"
will be your hot key letter and it's one of the rare few that isn't used by the
palmtop.

For Path enter,

a:\utility\ks.com \&\mfr\emileage.wk1/\Z

This will use keystuff to stuff the keystrokes to start Lotus and load the
file. The \Z zooms it to the small font. You can remove this if you like the
middle font better. Make sure to put in the correct path to KS.COM.

In Comments put an upside down question mark to keep keystuff from pausing when
it exits.
(Fn-3)

Go to Icon and cycle to you find the gas nozzle icon.

Hit OK to save and you are finished!

That's it, I hope you get as much use out of this as I have. I'm open to
improvements so send them if you have them.

Bugs: Some formulas don't update automatically, but they will be correct when
you reopen the file.

Mitchell Hamm
hamm@one.net
September 5, 1996










































(s3B(s0B