Nope, it doesn't matter how many gallons you put in it, as long as you fill it all the way up. So half full to all the way full is fine. Going down to just one gallon left is also fine, as long as you fill it all the way up. Even just buying 2 gallons is fine, if that's all it took to fill everything up.
The only way to (semi) accurately measure fuel consumption without complicated gauges and meters is to measure it by difference from full.
So say I have a 10 gallon tank and I drove 180 miles and it's nearly on empty. I fill it up (9 gallons worth) and find out I got 20mpg (180/9 = 20).
Now lets say I only drive 60 miles and I get gas again. Lets say to fill it up, I only need to buy 3 gallons of gas. That also gives me 20mpg (60/3 = 20).
This all works fine no matter how much you drive and how much fuel you buy, as long as you fill it back up when you go to a gas station. That makes sure we all start from a known quantity of maximum.
The problem is when you fill up, drive 180 miles, then only buy 2 gallons of $3 gas. Computing correct MPG from that is impossible, because it would appear as if you drove 180 miles on less than 2 gallons of gas (assuming $3 gas). If you filled up soon after, you would likely have driven only a few dozen miles and needed say, 9 gallons to fill up. That follow-up calculation would also be way off, coming up around 2mpg instead of 20.
So, to correctly track your mileage on this site, always fill your tank all the way up. It doesn't matter how much fuel you used as long as you track the miles driven (via odometer or tripometer readings) and the amount of fuel taken to get back to full, it will work out.
If you do this "incorrectly" by not filling your tank up completely, you will not gain an accurate reading of fuel economy on that tank - However, if you continue to collect data it will eventually average out to the correct average fuel economy over all of your driving. For instance, in the previous example, the driver filled up with 2 gallons @ 180 miles which suggests 90 mpg. Then he drove another 18 miles and put in 9 more gallons which suggests 2 mpg. The site appears to automatically average these, so your average fuel economy should be reported as 18, which is correct. Still, it is better to fill up all the way every time since knowing the fuel economy for a trip will give you better feedback about your driving habits, driving conditions, and the condition of your vehicle.
Ah - Also forgot to mention - even when you fuel up the tank all the way, it does not guarantee that the level of gasoline in the tank is exactly the same as the previous fillup, which introduces a small error. This error becomes more negligible the more fuel you put in your tank, so you will get a more accurate reading the lower your tank is when you fill-up. This error also will disappear in your average fuel economy.
rem83, as you can see in this test data, it doesn't actually average out correctly. The test data should all be 20mpg and the reported average is over 42mpg after one 2 gallon non-fill-up.
And yeah, filling up to the top isn't exactly and precisely accurate (based on temperature, topping off, etc) but measuring by difference from there and assuming it is nearly identical through the life of your monitoring is just about the only way to base the calculations accurately.
@mathowie - Your data isn't working out correctly because your algorithm is incorrect. An average of your fuel economy is not the same as your average fuel economy. You should be taking a weighted average of the fuel economy where the weighting factor is number of gallons in that fillup. therefore, instead of saying the average fuel economy of your two fillups is (90 mpg + 2 mpg) / 2 = 41 mpg what you're doing is (90 mpg * 2 gallons + 2 mpg * 9 gallons) / 11 gallons = 18 mpg. This method essentially works out to 'total distance driven on your vheicle / total gas consumed by your vehicle' and shouldn't be hard to implement in your code
Sorry for all of the double comments, but i just wanted to add on to that last one. Using your spreadsheet, you will calculate the average fuel economy of the vehicle (total miles driven / total gas consumed over the lifetime of the vehicle) and the average of your fuel economy for each fillup (just averaging gas mileage at every fillup) to be the same because you assumed that the fuel economy was a constant 20 mpg. It is also possible to get both averages to be the same if your fill-ups are always exactly the same size. In real-life, either condition is pretty unrealistic, so even if you fill your tank up all the way, the average fuel economy you're currently calculating will not be equal to the total distance traveled by the car divided by the total gas consumed by the car.
I know this would totally mess up the calculations, but lately, I've been running my van to almost empty, then re-fueling about half to two-thirds of a tank. I think the lower weight in fuel has helped my gas mileage. I guess there's no way to figure that out on this site, though.