+ Reply to Thread
Results 1 to 2 of 2

Finding the closest pair of values from two cells on the same row, in different columns...

  1. #1
    Registered User
    Join Date
    03-05-2012
    Location
    Huntsville, AL
    MS-Off Ver
    Excel 2010
    Posts
    22

    Finding the closest pair of values from two cells on the same row, in different columns...

    Okay, I am involved in a class that is putting us through a business simulation. I have devised a way to use Excel to help my team make the best possible choices. In the simulation, there is something called a perceptual map. Basically it is a graph with 5 circles located on it. Each circle represents a potential segment to sell to. Each year you are able to reposition your products to be inside the segments that you wish. This is done by assigning your product the proper coordinates X,Y to place them inside the desired circle on the map. Whew! It's much easier seen than explained...

    Here is my question: If I have a center coordinate for a segment (x,y) located in A1(x) and A2(y), and also have a database with each product, (A1:A???), their x coordinates (B1:B???), and their y coordinates (C1:C???), is there a way to find the top 10 combinations of x and y coordinates in the database to the center point coordinates, then return the name of the product?

    TIA!


    Example:

    A B C D E
    Angler 1 2 3 7
    Bait 2 3
    Costa 6 7
    Drink 4 7


    A=Products
    B=X Coordinates
    C=Y Coordinates

    D=X Coordinate (Center Point)
    E=Y Coordinate (Center Point)

    If I only wanted to find the top 2 closest matching combinations, my results would return:

    Drink 4 7
    Costa 6 7

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Finding the closest pair of values from two cells on the same row, in different column

    Hi

    Assuming that the example data above is in the range A1:E4 then try

    G1: =SQRT((B1-$D$1)^2+(C1-$E$1)^2) - copy down to G4
    H1: =INDEX(A:A,MATCH(SMALL($G$1:$G$4,ROW()),$G$1:$G$4,0)) - copy down to H2

    HTH

    rylo

+ 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