=COUNT(C3:C9) should work, depending on whether or not there is a
number in
C8. If there's a number in C8, you could use
=(COUNT(C3:C7)+COUNT(C9))
COUNT only counts numbers, not blanks, text entries or error
entries.
COUNTA() counts non-blank entries (which would include text and
even
error
indications within the range being counted).
Another option would be COUNTIF() as
=COUNTIF(C3:C9,">0")
which would only count numeric entries with values greater than
zero.
:
Thanks, it got me started! Item 3 is fine, =SUM(C3:C7,C9) is what
I
need. Item 4, a typo (sorry 'bout that) should have been E not C,
is
the
cost per gallon at each fuel stop, so =SUM(E3:E7, E9)/6 gives
average
cost per gallon. Thanks for the bit about total cost per fuel
stop.
Can you tell me about COUNT, I think this is what I need. In E
average
cost per gallon, there are 6 elements. How do I write the equation
to
count each element instead of hard coding a value which is subject
to
change.
Thank you!
Omo
message
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
7)
SUM(E3:E7) would give cost of all fuel purchased, SUM(D3
7)
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
7,E3:E7)/SUM(D3
7)
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
7)
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.
:
(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.