Yep, basically that's how fuel economy is calculated, miles driven divided by gallons used. The same is used for trucking companies that report fuel taxes (virtually all of them) with the added requirement of miles in each state (most of us will not have to do this).
So let's say I drive 1000 miles and use a total of 100 gallons, that maths out to 10 MPG. In my van, if I drive 800 miles on 40 gallons, that's 20 MPG. It works both ways, if you have an average fuel economy, you can estimate your fuel needs for a given trip, and you can use the national average for fuel costs (or in my case, I just round up from my local prices a bit). So if I'm planning a trip, I can use the GPS to get the round trip miles (usually rounded off to simplify the math), divide that by my estimated fuel mileage, multiply that by fuel cost. Example - 800 mile trip (each way), 1600 miles total, 20 MPG comes to 80 gallons, times $2.50 per gallon makes my travel budget $200. Since the numbers are rounded, I'd add a minimum of 10% but more likely I'd reserve $250 for the trip, since I might want to use my vehicle around town while I'm there.