+ Reply to Thread
Results 1 to 6 of 6

Automatic Interpolation and Range Finder

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    Austin
    MS-Off Ver
    Excel 2010
    Posts
    35

    Automatic Interpolation and Range Finder

    Hello all,

    I have two columns(A & B) . The first one has sorted values from smallest to largest. And I have two values (X & Y) that lie within that range.

    I would like to automatically select the maximum value from the second column (B), in the range defined as [X,Y] by taking the maximum of {linearly interpolating at X, linearly interpolating at Y, taking the maximum of the values of the range in between}. The range can increase and decrease, depending on the X and Y values. X will be always less than Y.

    Is there a way to do it without a macro?

    Thanks!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Automatic Interpolation and Range Finder

    OK, you totally lost me there

    upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    Austin
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Automatic Interpolation and Range Finder

    So here it is.

    Thanks.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Automatic Interpolation and Range Finder

    Hi -

    So I simplified this by skipping the interpolation part. You are really looking for the row of the value in column A equal to or less than T1 and the row of the value in column A equal to or greater than T2.

    So, I used SUMPRODUCT to AND the conditions to find the row that meets the first criteria, and likewise for the second criteria. The formula to find the first row is:

    =SUMPRODUCT((--($A$2:$A$31<=$D$2))*(--($A$3:$A$32>$D$2))*ROW($A$2:$A$31))+1

    The upper end row is:

    =SUMPRODUCT((--($A$2:$A$31<=$E$2))*(--($A$3:$A$32>$E$2))*ROW($A$2:$A$31))+1

    Finally, I use INDIRECT to build the address range to search and finally MAX to search that range for the maximum value. That formula looks like:

    =MAX(INDIRECT("B"&TEXT(D5,"###")&":B"&TEXT(E5,"###"),1))

    I have attached your worksheet with these modifications.

    Hope this helps.
    Attached Files Attached Files
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  5. #5
    Registered User
    Join Date
    06-22-2012
    Location
    Austin
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Automatic Interpolation and Range Finder

    Thanks a lot!

    As you said, not exactly what I wanted, but I got the logic so I can work from there and on.

    Thanks a bunch!

  6. #6
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,292

    Re: Automatic Interpolation and Range Finder

    I offer the option of using AGGREGATE and FORECAST functions .
    Attached Files Attached Files

+ 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] Bilinear Interpolation VBA function for range
    By rajsh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2015, 07:52 AM
  2. Range finder
    By samder68 in forum Excel General
    Replies: 5
    Last Post: 04-22-2014, 04:44 PM
  3. [SOLVED] Using range offset and Hlookup in an interpolation function
    By ImperatorAtticus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2012, 06:40 AM
  4. Replies: 0
    Last Post: 07-24-2008, 02:27 PM
  5. Trace Precedents/Range Finder etc
    By Mick_Yz125 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2008, 02:21 AM
  6. Totally Lost - Dates in huge table, Range finder
    By kempy1000 in forum Excel General
    Replies: 4
    Last Post: 08-15-2006, 03:04 PM
  7. [SOLVED] How to build a forward/back range finder
    By John Wirt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2005, 05:05 PM

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