+ Reply to Thread
Results 1 to 4 of 4

Oil Change Formula

  1. #1
    Registered User
    Join Date
    06-08-2013
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2010
    Posts
    2

    Oil Change Formula

    Hello, I am working on a formula to indicate when an oil change is required. I have a cell that gives me starting mileage (d3), and a series of cells that give me mileage at fueling (b:b). What I am looking for is a way to calculate how close I am to my next oil change in cell j3. I know that the beginning of the formula would be =sum(b:b)-d3, but I do not know where to go from here. I would like the counter cell to reset each time 3000 miles is hit, and then start the countdown from there.

    Thanks,
    Brian

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Oil Change Formula

    Maybe: =MOD(SUM(B:B)-D3, 3000)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-08-2013
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Oil Change Formula

    Thank you! This did work, although I did change the formula to =MOD(SUM(B:B)-D3, -3000) to give me a countdown as opposed to counting up. I was not familiar with the =MOD function.

    This did also bring up two more questions if you would like to take a crack at them...

    I am working on the Average MPG on this sheet, and I am not sure how to have the formula in cells that have yet to be calculated without it factoring into the grand equation. Also, is there any way to remove the "#DIV/0!" in an un-calculated cell so that it just appears blank? I tried an "=if(isblank" equation, but it did not do anything.

    Thanks again!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Oil Change Formula

    THe DIV/0 error requires you check the denominator cell first, only apply the formula if something more than 0 is there.

    =A1/B1

    becomes

    =IF(B1>0, A1/B1, "")


    You can use the same thing to test the numerator and not run other formulas unless something is there:

    =A1*24

    becomes

    =IF(A1=0, "", A1*24)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1