+ Reply to Thread
Results 1 to 5 of 5

Search for a value in a table an return separate x and y coordinates of all its locations

  1. #1
    Registered User
    Join Date
    08-22-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Search for a value in a table an return separate x and y coordinates of all its locations

    i have a large table and i need separate x and y coordinates(to plot on a graph) of a particular repeated value that is known to me in a large table of numbers.
    how can i do this?

  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: Search for a value in a table an return separate x and y coordinates of all its locati

    I would write a custom function for this. Is a UserDefinedFunction (vba) ok? Not everyone likes macros enabled in their workbooks.
    _________________
    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
    08-22-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Search for a value in a table an return separate x and y coordinates of all its locati

    it'd be great! thanks alot

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

    Re: Search for a value in a table an return separate x and y coordinates of all its locati

    So I do it correctly, can you provide a sample workbook with a demonstration of the data and a manual mockup of the results you're trying to achieve?


    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  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: Search for a value in a table an return separate x and y coordinates of all its locati

    Here's a UDF that you can add into your workbook:

    Please Login or Register  to view this content.
    How to install the User Defined Function:
    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook

    The function is installed and ready to use.

    In a cell:

    =XY(TableRange, ValueToMatch, InstanceToReturn)

    In the attached sheet, I put this into L3 and copied down:

    =xy($A$1:$C$14, $J$3, ROW(A1))

    The ROW(A1) is just a trick that resolves to "1" so it returns the first match found. As that formula is copied down that part increments and gives you the next match.

    The formulas in M:N split that string out, create your chart from those columns.
    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. Locate Number in Table and Return Coordinates.
    By alexie0830 in forum Excel General
    Replies: 8
    Last Post: 08-22-2013, 01:41 PM
  2. Multiple data labels (in separate locations on chart)
    By TimXinn in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-16-2013, 05:58 AM
  3. [SOLVED] Using a Macro to search several predetermined locations to return "yes/no"
    By mpricha in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-27-2012, 08:45 PM
  4. [SOLVED] Search to return multiple locations for query value
    By catt33 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-23-2012, 03:50 PM
  5. [SOLVED] Count Unique Locations based on Separate Departments
    By cdotyii in forum Excel General
    Replies: 6
    Last Post: 04-18-2012, 11:36 AM

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