+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    01-20-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Returning Value Based on Changing Date

    Ok here’s my dilemma. I have a table listing various entries based on name, amount and date of entry. In a separate table I would like to request the newest value entered for a name (maybe the newest and the one before the newest as well). So in table A I have categories X, Y and Z: X is a name, Y is an amount, and Z is the date of transaction. Table A is simply a running record sorted by newest entry to oldest entry. In Table B I have categories X, S and T: X is again a name, S is the newest/most-recent entry (i.e. Y for the amount) made by X in Table A, and T is the penultimate (i.e. Y-1) entry made by X in Table A. I’m fairly new to this excel thing, but I’m sure there’s an easy fix for this. Please help.
    Last edited by aram87; 02-10-2010 at 04:56 PM.

  2. #2
    Valued Forum Contributor khamilton's Avatar
    Join Date
    10-08-2009
    Location
    IL
    MS-Off Ver
    Excel 2007
    Posts
    341

    Re: Returning Value Based on Changing Date

    Maybe you could post a sample attachment with your setup on the results you would like then I think you could get more help.
    Please acknowledge the response you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  3. #3
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Returning Value Based on Changing Date

    To keep things simple let's create some dummy ranges...

    Let's assume "TableA" is on sheet1 and X is Col A, Y is Col B and Z is Col C
    Let's assume "TableB" is on sheet2 and X is Col A, S is Col B and T is Col C

    For ease of calculation let's add a column to "TableB"

    Sheet2!D2: =MATCH($A2,Sheet1!$A$1:$A$1000,0)

    The above (let's say this is "R") returns the first row on Sheet1 that contains the name of interest... given the data on Sheet1 is sorted newest to oldest this row contains "S"

    Sheet2!B2: =VLOOKUP($A2,Sheet1!$A$1:$C$1000,3,0)

    Given we know the row in which "S" appeared ("R") we can repeat the process for "T" but this time we adjust the range to exclude all rows up to and including row "R"
    so we find the first match in the remaining range - ie the 2nd record

    Sheet2!C2: =VLOOKUP($A2,INDEX(Sheet1!$A:$A,$D2+1):Sheet1!$C$1000,3,0)

    Does that help ?

Thread Information

Users Browsing this Thread

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

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.2.0