This function works for small figures but not for large

B

Bob H

I was looking around for function for excel 2007, and came across this one.

Function MPG(StartMiles As Integer, FinishMiles As Integer, Litres As
Single)
MPG = (FinishMiles - StartMiles) / Litres * 4.546
End Function

=MPG(A2,A3,C3)

A2= 3252
A3= 3507
A4= 3829

C1= 0
C2= 30.59
C3= 37.05

If I type some small figures in the cells A1, A2, A3 like 3529 miles etc
the the function works ok, but if I type a large figure like 35290
miles, then it comes up with a #NUM! error.

How can I get the figures corrected for large figures?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top