+ Reply to Thread
Results 1 to 4 of 4

Trying to obtain the maximum value of only certain rows

  1. #1
    Registered User
    Join Date
    08-31-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Trying to obtain the maximum value of only certain rows

    Hi all.... I have used Excel for many many years (and love it). I currently have a problem that I can't seem to solve efficiently.

    Ok.. So I am creating a vehicle maintenance spreadsheet. I have one sheet that is a complete log of everything that I do with the vehicle, then another sheet that you plug in the current mileage and it tells you when your next oil change is due, tune up, etc. So here is the problem.

    I am trying to reference my main log page and basically create a formula for each maintenance item that says something like this:

    Do a lookup on the main log. Find all rows that list "1 - Oil Change" and of ONLY THOSE ROWS find the maximum mileage and use that in this field + 3000 miles.

    I would create that for each maintenance item. I tried a

    =VLOOKUP(AND("Oil Change",MAX(C1:C200).....

    It didn't like that (and I didn't think it would - lol). Any ideas?

  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: Trying to obtain the maximum value of only certain rows

    This is an array formula.

    Assuming column A is "event type" and column C is mileage, assuming in F2 you enter "oil change" and would like a formula in G2 to get the "next" one:

    G2: =MAX(IF(A1:A100="oil change", B1:B100)) + 3000
    or.... =MAX(IF(A1:A100=F2, B1:B100)) + 3000

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    _________________
    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
    08-31-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Trying to obtain the maximum value of only certain rows

    Yup this was exactly what the doctor ordered!!!! In my many many years using Excel this is one thing I never used (or really knew about!). Glad to have learned it!

    Thanks so much for your help.

  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: Trying to obtain the maximum value of only certain rows

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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: 1
    Last Post: 06-14-2012, 09:27 AM
  2. Replies: 1
    Last Post: 01-20-2012, 07:17 AM
  3. Highlighting Rows below a Maximum Value
    By csaunders86 in forum Excel General
    Replies: 5
    Last Post: 12-09-2011, 04:47 PM
  4. obtain specific rows and column from access table
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2010, 07:44 AM
  5. [SOLVED] VBA to obtain Max Rows in any column in Used Reange
    By donoteventry;removes;[email protected] in forum Excel General
    Replies: 4
    Last Post: 07-24-2006, 08:30 PM

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