+ Reply to Thread
Results 1 to 5 of 5

Finding graph X,Y coordinates using Mouse Cursor

  1. #1
    Registered User
    Join Date
    02-25-2017
    Location
    Limerick, Ireland
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    2

    Question Finding graph X,Y coordinates using Mouse Cursor

    I've attached a photo of problem.

    I'm trying to find the exact x-axis coordinate, when this line crosses the various y-axis points.

    For example, in the picture the line hits a Y-axis value of 4 at approximately X=0.235, this is done by eye.

    Is there an easier way to query where the line crosses the these points, for example using the Mouse Cursor?

    Capture.PNG
    Cheers,

    Fionn

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Finding graph X,Y coordinates using Mouse Cursor

    Welcome to the Forum!

    I don't know of a way to do this with the cursor but it could be done by interpolation using the source data. I'm assuming that the graph is in Excel, generated by data in Excel. The accuracy of the interpolation would depend on how close together the data points are, but just by eyeballing it, it looks like linear interpolation would be a good approach here.

    You can get fancier by using macros to do the interpolation based on some Y value you select, so it could be interactive.

    I could provide a more concrete answer if you can attach your file. Under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-25-2017
    Location
    Limerick, Ireland
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    2

    Thumbs up Re: Finding graph X,Y coordinates using Mouse Cursor

    Hi 6StringJazzer and thank you!

    I've attached a file. It's not the original as I've some sensitive data in their which I can't give out... (or men in suits might come to my door and shoot me ).

    However, this file should explain my problem. Thank you for your help so far.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Finding graph X,Y coordinates using Mouse Cursor

    Your file says:

    I need to find the X-axis coordinates where the trendline (red) meets the Z axis

    That is quite different than the question you asked above. Your first question didn't indicate that you were showing a trendline, and you seemed to be looking for the y value at an arbitrary x value.

    To answer the question you ask in your file, the trendline meets the Y axis (labelled Z on your chart) where x=0. That means you just need the constant value from the trendline equation. The quickest way to do this is look at the equation. Right-click on the trendline, select Format Trendline, then check the box for Display Equation on Chart. For Plot 1 that is:

    y = -4207.1x^6 + 12509x^5 - 14934x^4 + 9110.8x^3 - 2979.8x^2 + 504.89^x - 32.291

    So the trendline crosses the Y axis at -32.291.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,820

    Re: Finding graph X,Y coordinates using Mouse Cursor

    I will agree, you could be clearer about what exactly you want.

    As 6stringjazzer notes, to obtain the z value at x=0, simply put 0 in for x in the trendline and compute y (which is just the constant term in the polynomial). For other values of x, simply put that value for x in and compute z.

    From your original post, I first thought you were looking to give the equation z, then find x. For a 6th order polynomial, this is not possible algebraically, but one can easily use numerical algorithms to solve for x at a given z. Usually the easiest approach is to use Excel's built in Solver/Goal Seek utilities.

    In all of these scenarios, the main "difficulty" to your problem is that you have used the chart trendline feature to perform the regression, so you need to transfer the equations coefficients into the spreadsheet. If this is a one time or rare task, then it is probably easiest to simply hand enter the coefficients into the spreadsheet. If this is something you will need to do frequently, I recommend that you become familiar with using the LINEST() function to perform polynomial regressions. The help file (https://support.office.com/en-us/art...a-fa7abf772b6d ) includes an example for a 3rd order polynomial. Extending that to a 6th order polynomial should be straightforward.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. Finding the x y coordinates by using mouse over.
    By DNA007 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-16-2012, 06:33 PM
  2. Finding the x y coordinates by using mouse over.
    By DNA007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-11-2012, 03:27 PM
  3. Mouse Coordinates in userform
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-31-2008, 04:57 AM
  4. [SOLVED] Mouse X-Y Coordinates
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2006, 11:40 PM
  5. [SOLVED] Can I grab graph coordinates in Excel via the mouse with VB?
    By Chris Manning in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 08-21-2005, 10:05 PM
  6. finding the coordinates of the maximum point on a graph
    By eastham85 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-16-2005, 10:06 AM
  7. Mouse coordinates
    By Fustin Fran癟ois in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2005, 10:36 AM

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