+ Reply to Thread
Results 1 to 8 of 8

How do I put a vertical line on a graph that slides based on a entered value

  1. #1
    Forum Contributor
    Join Date
    01-29-2018
    Location
    United states
    MS-Off Ver
    2019
    Posts
    242

    How do I put a vertical line on a graph that slides based on a entered value

    Ok I have a graph and on my excel sheet, and I would like to put a line in it that moves left or right based on a an entered value. For example if the entry is 0.00 it should be at the left, if I enter 4.19 in Cell I4 it the line should appear at the center point of the curve, and so on....

    How do I do this.
    Please let me know
    Brad.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How do I put a vertical line on a graph that slides based on a entered value

    Please try at S3

    =100*(MATCH(MIN(INDEX(ABS($I$4-$N$3:$N$1703),)),INDEX(ABS($I$4-$N$3:$N$1703),),)=ROWS(S$3:S3))

    Then add S3:S1703 to chart
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    01-29-2018
    Location
    United states
    MS-Off Ver
    2019
    Posts
    242

    Re: How do I put a vertical line on a graph that slides based on a entered value

    Bo Ry
    Very Slick Thank YOU!!!!

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,256

    Re: How do I put a vertical line on a graph that slides based on a entered value

    =IF(N3=$I$4,100,0)
    I think this formula in S3 also works
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Forum Contributor
    Join Date
    01-29-2018
    Location
    United states
    MS-Off Ver
    2019
    Posts
    242

    Re: How do I put a vertical line on a graph that slides based on a entered value

    Ok I used Bo Ry's code and it works, but now the graph reads -20 instead of a 0 base line. Why and how do I fix it???

  6. #6
    Forum Contributor
    Join Date
    01-29-2018
    Location
    United states
    MS-Off Ver
    2019
    Posts
    242

    Re: How do I put a vertical line on a graph that slides based on a entered value

    Quote Originally Posted by popipipo View Post
    =IF(N3=$I$4,100,0)
    I think this formula in S3 also works
    Popipipo I put your code into s3 and dragged it down and your code works too, however just like Ry's it changes the graph to a -20 value base line instead of 0 please see previous post for the updated workbook How do I fix the -20 error?
    Last edited by born2dive00; 05-16-2020 at 05:07 PM.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How do I put a vertical line on a graph that slides based on a entered value

    Format axis minimum to 0

    or use this formula at S3

    =IF(ROUND(N3,2)=$I$4,100,IF((MATCH(SMALL(INDEX(ABS($I$4-$N$3:$N$1703),),2),INDEX(ABS($I$4-$N$3:$N$1703),),)=ROWS(S$3:S3)),0,NA()))

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: How do I put a vertical line on a graph that slides based on a entered value

    If the line position is controlled by manual entry of value into I4 then you can just use a single point series with a minus 100% Y error bar
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

+ 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. Vertical Dotted Line on Graph
    By K-Linerz in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-22-2016, 09:47 AM
  2. [SOLVED] macro to draw a vertical line on a graph
    By kbaruin in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 10-08-2012, 07:01 AM
  3. [SOLVED] Adding two vertical line graphs to a bar graph
    By futbolfan in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-16-2012, 07:55 PM
  4. Add a vertical line to a line graph
    By Karen311261 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-07-2012, 08:12 AM
  5. Replies: 1
    Last Post: 04-11-2012, 10:26 AM
  6. Excel 2007 : Insert vertical line into graph
    By SoftwareTester in forum Excel General
    Replies: 1
    Last Post: 04-16-2010, 04:26 AM
  7. graph with a vertical line across a certain X value?
    By Chokri in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 07-08-2009, 05:48 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