+ Reply to Thread
Results 1 to 9 of 9

IFTA Mileage calculation spreadsheet killing me

  1. #1
    Registered User
    Join Date
    10-06-2014
    Location
    Greenville, SC
    MS-Off Ver
    2010
    Posts
    27

    Unhappy IFTA Mileage calculation spreadsheet killing me

    Ok. Try to explain this simply. I have a list of states. The trucker has to log his miles. He may go to some states, may not go to others. I need to be able to do the calculation properly if some states are left blank. Here is an example. I added GA and FL, but don't know how to write a statement that if 0 or blank, then use the next state, or continue on until it finds a number greater than zero. Look below. The formula for the calculated is simple it's next state minus the current state. B18-b17 (as an example). Now, what if 1, 2 or many states aren't used. I can't use that formula, I can't even do a simple IF. I'm really struggling on this one.

    Mileage Calculator
    State Mileage Calculated Miles
    SC 155300 3
    NC 155303 175
    TN 155478 287
    KY 155765 92
    Ill 155857 165
    MS 156022 488
    Ill 156510 160
    Ky 156670 95
    TN 156765 291
    NC 157056 172
    SC 157228 3
    Ft Mill 157231
    Total Miles 1931

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: IFTA Mileage calculation spreadsheet killing me

    I get what you're asking, but could you post a sample workbook so I can make sure a solution works in the context you provide?

  3. #3
    Registered User
    Join Date
    10-06-2014
    Location
    Greenville, SC
    MS-Off Ver
    2010
    Posts
    27

    Re: IFTA Mileage calculation spreadsheet killing me

    Quote Originally Posted by mcmahobt View Post
    I get what you're asking, but could you post a sample workbook so I can make sure a solution works in the context you provide?
    Lets see if this attached correctly.

    Thank you.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: IFTA Mileage calculation spreadsheet killing me

    Copy into cell C15 and drag down:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-06-2014
    Location
    Greenville, SC
    MS-Off Ver
    2010
    Posts
    27

    Re: IFTA Mileage calculation spreadsheet killing me

    I'm trying nested If's. I'm not having any luck. Hope you get me pointed in the right direction, then I can add more states and move on. Thank you.

  6. #6
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: IFTA Mileage calculation spreadsheet killing me

    Did you see my last post?

  7. #7
    Registered User
    Join Date
    10-06-2014
    Location
    Greenville, SC
    MS-Off Ver
    2010
    Posts
    27

    Re: IFTA Mileage calculation spreadsheet killing me

    Quote Originally Posted by mcmahobt View Post
    Copy into cell C15 and drag down:

    Please Login or Register  to view this content.
    I did so. It works. I added 2 more needed states, then reapplied the formula and end up with what you see attached. The mileages are now off
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-06-2014
    Location
    Greenville, SC
    MS-Off Ver
    2010
    Posts
    27

    Re: IFTA Mileage calculation spreadsheet killing me

    My bad. Fixed. Thank you, a nice elegant solution. Now to figure out what you did so I can learn from it. How do I mark this as solved?
    Last edited by dceremuga; 10-06-2014 at 02:30 PM.

  9. #9
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: IFTA Mileage calculation spreadsheet killing me

    Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 10-01-2012, 12:11 PM
  2. Replies: 1
    Last Post: 02-08-2012, 11:37 AM
  3. Simple Mileage Calculation Form
    By maxima302 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-05-2008, 01:08 PM
  4. [SOLVED] Mileage Calculation
    By Cathy Landry in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-07-2005, 04:35 PM
  5. Mileage calculation
    By Hardy03 in forum Excel General
    Replies: 2
    Last Post: 08-30-2005, 08:05 AM

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