+ Reply to Thread
Results 1 to 7 of 7

Array Formula to find an offset value based on a certain condition.

  1. #1
    Registered User
    Join Date
    05-07-2014
    Location
    Missouri, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Array Formula to find an offset value based on a certain condition.

    I have three columns of Data. A is vehicle number, B is miles and C is a Date. I want to be able to pull the miles for the newest date when the user types in a bus number next to the formula. I think It can be done with an array formula but I am not 100% sure on how to do it. Any help would be appreciated. Also is it possible if they enter a vehicle number and a date that a different formula finds the miles for the most recent date to the date entered.

    Thanks.

    Monte

    Excel Help.JPG

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Array Formula to find an offset value based on a certain condition.

    Hi,
    Let me cite after http://www.excelforum.com/forum-rule...rum-rules.html
    Post a WORKBOOK. Nobody wants to type data from a picture or paste text from your post into a spreadsheet as a prelude to helping. To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    05-07-2014
    Location
    Missouri, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Array Formula to find an offset value based on a certain condition.

    Thank you Kaper for the information. Here is a sample of what I am doing. Company policy won't allow me to post the actual document online.
    Attached Files Attached Files

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Array Formula to find an offset value based on a certain condition.

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    Vechicle
    Miles
    Date
    ------
    Vechicle
    Miles
    2
    4
    15474
    3/1/2014
    3
    10895
    3
    3
    10895
    3/4/2015
    4
    1
    17761
    3/1/2014
    5
    3
    19445
    6/8/2014
    6
    3
    18298
    3/1/2015
    7
    3
    11609
    6/7/2014
    8
    4
    13725
    2/15/2014
    9
    1
    14215
    7/8/2014
    10
    2
    13935
    9/12/2014
    11
    4
    15362
    8/30/2014
    12
    1
    13101
    6/3/2014
    13
    3
    11764
    7/4/2014
    14
    4
    10133
    1/8/2011
    15
    4
    12653
    6/1/2014
    16
    3
    18324
    3/2/2014
    17
    4
    15152
    2/8/2014
    18
    2
    14242
    3/7/2014
    19
    2
    17013
    3/4/2014
    20
    4
    14573
    6/1/2014


    This array formula** entered in F2:

    =INDEX(B2:B20,MATCH(MAX(IF(A2:A20=E2,C2:C20)),IF(A2:A20=E2,C2:C20),0))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Array Formula to find an offset value based on a certain condition.

    And
    Also is it possible if they enter a vehicle number and a date that a different formula finds the miles for the most recent date to the date entered
    Enter the date in D2 and again array formula:

    Please Login or Register  to view this content.
    would do.

    PS. nobody wants you to publish company data. Exactly* such sample file as you attached was what I ment.

    *) Well, this case text explanation was (probably) good enough, but often it is wise to show also "manualy calculated" result(s). So in such case filled with data E2, D2, and manualy assessed F2 (miles for last), G2 (miles for last before D2).

  6. #6
    Registered User
    Join Date
    05-07-2014
    Location
    Missouri, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Array Formula to find an offset value based on a certain condition.

    Thank you both for the information it was very helpful and solved my problem!

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Array Formula to find an offset value based on a certain condition.

    You're welcome. We appreciate the feedback!

+ 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. [SOLVED] Formula to return an offset value depending on a condition
    By Herr Rommel in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-20-2013, 03:38 PM
  2. [SOLVED] Formula to find out MAX and MIN based on 3rd cell condition
    By helpbitte in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2013, 05:31 AM
  3. [SOLVED] Return an array based on condition
    By ecelaras in forum Excel General
    Replies: 10
    Last Post: 11-23-2012, 11:01 AM
  4. vba help pls - find min based on a condition and return val of an offset cell
    By Impakt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2005, 08:06 PM
  5. Find Min based on condition & return val of offset cell
    By impakt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2005, 09:12 AM

Tags for this Thread

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