Excel n00b, how to do basic math functions
All examples assume we are in row 2.
(1) in F2 put
=C2/D2
(2) (and normal annotation is column letter first, followed by row number).
In B10 put this formula
=B9-B2
(3) I think what you want in C10 is
=SUM(C3:C7)
That gives a total of values in C3, C4, C5, C6 and C7 which would be total
of trip odometer readings.
(4) (presuming column E here vs C)
I think we got a little confused here. We need number of gallons purchased
along with the purchase cost at each stop. We will assume that column D
[from (1) above] has the # of gallons purchased and E has the total purchase
price. Then in E10 you could put
=SUM(E3:E7)/SUM(D3:D7)
SUM(E3:E7) would give cost of all fuel purchased, SUM(D3:D7) would give
total cost for those gallons, and the formula result would be the price per
gallon.
(4a) but if column E actually has price per gallon vs total cost at the
stop, then for E10 we need a formula like this:
=SUMPRODUCT(D3:D7,E3:E7)/SUM(D3:D7)
The sumproduct() takes each value in column D and multiplies it by the value
in column E and gives a running total, so that is the total of each #Gallons
* Price per Gallon which is total cost for the fuel. The SUM(D3:D7) gives us
the total gallons purchased, so dividing the SUMPRODUCT() result by the SUM()
result gives you an average cost per gallon.
Reattempting post, please pardon me if it gets posted twice, system
hiccuping badly tonight.
"Omohundro" wrote:
(1)
Column C has miles
Column D has gallons
I wish to have Colum F determine MPG or C÷D=F
(2)
Column B has Odometer reading
Row 2B has start, Row 9B has end
I wish to have Row 10B determine total miles or 9B-2B=10B
(3)
Column C has Trip Odometer reading
Row 3C-7C and 9C has mileage since last fillup
I wish to add each designated value to a running total at 10C
(4)
Column E has cost per gallon
Row 3C-7C and 9C has cost/gal at each gas stop
I wish to add each designated value to a running total and divide by
number of gas stops to get average cost per gallon.
Thanks for your help.
|