+ Reply to Thread
Results 1 to 14 of 14

Fleet Services

  1. #1
    Registered User
    Join Date
    07-27-2006
    Posts
    68

    Fleet Services

    You guys have all been a tremendous help for me in the past. I have learned a lot about the more complex excel formulas just for some help. But now I am trying to make a very large spreadsheet for the company I work for that will help us keep track of our fleet. There are some formulas that would help us do this, but I dont know them.


    Problem 1
    The first thing I need help with is a table I made of all of our drivers. The drivers name is on the left side of the table, and there is other information along the top of the chart. The first column (B) of the table should count the number of driving complaints that each driver has. So the formula should look for the drivers name in column A, find the worksheet with that same name, and count the number of occurances for that name in row F on a tab called "Driving Violations". If count cannot search an entire column, then it can just look at F2:F200 or so.



    Problem 2
    The second column on the table (C) is in referrence to a certifiction that all of our technicians have. This column should look at the techs name in row A, move to the worksheet "employees", find that name in row a, then find the certifications expiration date from column D, and return that date less three months. The three months is just to give me time to get the tech in a class before the certification expires.

    Back on my "Fleet" tab, I have column D as an if statement. Yes is returned if the odometer is greater than the oil change mileage. The only thing is that I want some advanced notice so I can tell my boss what to expect.

    heres the formula i am using now:
    IF(MAX(INDIRECT(A3&"!"&"d2:d500"))>MAX(INDIRECT(A3&"!"&"e2:e500")), "Yes", "No")

    I want yes to return if max of row E minus max of row D is less than or equal to 500 miles.


    This is still a work in progress, so I might ask more questions later. But Ill try to figure the rest out on my own first.
    Thanks for you help!

  2. #2
    Registered User
    Join Date
    07-27-2006
    Posts
    68
    =IF(MAX(INDIRECT(A5&"!"&"d2:d500"))-MAX(INDIRECT(A5&"!"&"e2:e500"))>=-500 or(MAX(INDIRECT(A5&"!"&"d2:d500"))>MAX(INDIRECT(A5&"!"&"e2:e500")), "Yes", "No")

    This would fix the oil change problem, but the syntex is wrong.

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Something like

    =IF(OR(MAX(INDIRECT(A5&"!"&"d2:d500"))-MAX(INDIRECT(A5&"!"&"e2:e500"))>=-500,(MAX(INDIRECT(A5&"!"&"d2:d500"))>MAX(INDIRECT(A5 &"!"&"e2:e500")))),"Yes", "No")

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    07-27-2006
    Posts
    68
    Awsome, thats it. I was trying to get it to work, and just googled the or syntex, so i was close, but had the paranthesis wrong.

    you guys have any idea for the first problem?

    edit: ill try to play with the v-lookup for my first problem. im thinking that will work. but im still open to suggestions.

    edit(again): I made a mistake. the formula i gave in my original post is in referrence to a third problem I did not mention. Im still working on the problems from the first post. if anyone has an answer, that would be greatly appreciated.
    Last edited by speakers_86; 03-29-2007 at 04:34 PM.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No Problem.

    Can you confirm

    Is there a tab for the driver or is it a tab for Driving Violations.

    Whats in Column F and Is the driver name shown in the sheet and in what col

    VBA Noob

  6. #6
    Registered User
    Join Date
    07-27-2006
    Posts
    68
    =VLOOKUP(A3,'Driving Violations'!F2:F500,1)

    whats wrong with this?

    edit, the table is not sorted, thats why it didnt work.

    but basically this is what I need:
    =COUNT(VLOOKUP(A6,DrivingViolations!F2:F500,1))

    But I cant use vlookup because the table is not sorted, what are my other options instead of vlookup?
    Last edited by speakers_86; 03-29-2007 at 04:57 PM.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If it works for you then nothing.

    Note: You might want to fix your range F2:F500 or amend to F:F
    Plus if no violations then you would get #N/A so try

    =IF(ISNA(VLOOKUP(A3,'Driving Violations'!F:F,1,FALSE)),"",VLOOKUP(A3,'Driving Violations'!F:F,1,FALSE))

    VBA Noob

  8. #8
    Registered User
    Join Date
    07-27-2006
    Posts
    68
    I tried your equation and a box poped up that looked like the box when you click save as. Im not sure what to do with it.

    but basically this is what I need:
    =COUNT(VLOOKUP(A6,DrivingViolations!F:F,1))

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =COUNTIF(DrivingViolations!F:F,A3)

    VBA Noob

  10. #10
    Registered User
    Join Date
    07-27-2006
    Posts
    68
    Okay, so I tried that and it returned 0 for all values, which is not right.

    edit: countif only counts numbers, not words
    Last edited by speakers_86; 03-29-2007 at 05:20 PM.

  11. #11
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Going back a bit. I asked earlier what's in Col F If it's the driver name it should work

    VBA Noob

  12. #12
    Registered User
    Join Date
    07-27-2006
    Posts
    68
    i figured it out, I had the name spelled two different ways. and that box i mentioned that poped up was because i changed the name of the drivers complaints worksheet and didnt change the referrence to that page in the formula. so excel wanted me to update it on were the page was. kind of like what itunes does when you change the file name or delete an mp3 file

    But it worked, thanks for your help

  13. #13
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No problem

    Got there in the end

    VBA Noob

  14. #14
    Registered User
    Join Date
    07-27-2006
    Posts
    68
    heres what I need for the certification problem I mention.

    =or(IF((VLOOKUP(A3,Employees!A2:D18,4))>=12/7),Vlookup(A3,Employees!A2:D18,4)<3/08,Yes,No)

    This is similar to the oil change problem. Except, instead of 500 miles notice, I want 3 months notice. Im not sure if excel will recognize that 3/08 is a date. Maybe there is a better way to do this.

+ 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