+ Reply to Thread
Results 1 to 6 of 6

Lookup and Display of Matched Cell Data?

  1. #1
    Registered User
    Join Date
    01-20-2011
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Lookup and Display of Matched Cell Data?

    Hello,
    I have a two column list of "Days" and "Dollars." Days increase, dollars decrease. The amount the dollars decrease changes as you play around with some variables determined elsewhere. It's basically a quick forecasting tool, and allows you to fiddle with numbers to see when you'll get to a particular dollar amount.

    Consequently, I would like a way to have a cell display the "Day" that closest matches a predetermined dollar amount defined in another cell. Rough is OK, it doesn't matter if it is slightly over or slightly under.

    In more real world terms, suppose I have days 1-365 in column A, and dollar amounts starting at 5,000 and ending around 1,000 in column B descending. I'd like to be able to put "$3384" in a cell, and have another cell display the Day that is more or less closest to that amount.

    Is this possible in real time? (ie, something that changes as you change numbers on the worksheet?)

    Thanks,
    Nathan
    Last edited by Nathanf; 01-11-2012 at 06:46 AM.

  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: Lookup and Display of Matched Cell Data?

    Let's say you're entering your search $ value in cell M1.

    In column C you could put a "key" formula to assist with this. In C1 put this formula:

    =ABS($M$10-$A1)

    Copy that down the whole data set.

    Then in N1 you can put this formula to bring back the closest day matching your M1 value:

    =IF(M1="", "", INDEX(A:A, MATCH(SMALL(C:C, 1), C:C, 0))
    _________________
    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
    01-20-2011
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Lookup and Display of Matched Cell Data?

    Thanks! It took some tweaking and looking up what those particular functions do, but it's working perfectly now. Your expertise is much appreciated!

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,472

    Re: Lookup and Display of Matched Cell Data?

    Supposed your dates are in A1:A365, amount in B1:B365, your seach amount in E2, return date in F2.
    In F2:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Lookup and Display of Matched Cell Data?

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  6. #6
    Registered User
    Join Date
    01-20-2011
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Lookup and Display of Matched Cell Data?

    Quote Originally Posted by bebo021999 View Post
    Supposed your dates are in A1:A365, amount in B1:B365, your seach amount in E2, return date in F2.
    In F2:
    Please Login or Register  to view this content.
    Thanks much!

+ 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