+ Reply to Thread
Results 1 to 2 of 2

Find nearest value from data range

  1. #1
    Registered User
    Join Date
    02-04-2010
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2003
    Posts
    7

    Find nearest value from data range

    I have a 2D data range (all numbers) on one worksheet, and from another worksheet I'd like to look up the closest value to an input. From there I need to know the column and row header names, and that's it. It sounds pretty simple, but I can't figure out how to do it without long convoluted loops and if statements. Can anyone point me toward an elegant solution?

    Thanks in advance!

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find nearest value from data range

    By nearest we presume this means above/below ?

    If we assume data is stored on Sheet1 in A1:D100 and data point of interest is entered into A1 on Sheet2 then the below gets co-ordinates of closes match in B2:D100 range (given A and row 1 are headers)

    Please Login or Register  to view this content.

    Note text in red - ie Array.


    From which you can retrieve associated values:

    Please Login or Register  to view this content.

    Adjust ranges to suit obviously

+ 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