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

1. ## 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.  Register To Reply

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

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

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

Bo Ry
Very Slick Thank YOU!!!!  Register To Reply

4. ## 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  Register To Reply

5. ## 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???  Register To Reply

6. ## Re: How do I put a vertical line on a graph that slides based on a entered value Originally Posted by popipipo =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?  Register To Reply

7. ## 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()))  Register To Reply

8. ## 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  Register To Reply