Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Horizontal line on Excel chart

Posted on 2012-04-02
Medium Priority
342 Views

This application automatically provides historical market pricing and charts for specified funds/indicies. I need to update the charts to include extra horizontal lines -40% and -60% lower than the closing price for the last day. I am refreshing the data on a daily basis so the solution needs to be dynamic.

Any help/advice would be welcome.
0
Question by:draeside
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• Learn & ask questions
• 5
• 2
• 2

LVL 43

Expert Comment

ID: 37799519
Can you provide a sample file?
0

LVL 50

Expert Comment

ID: 37799556
Hello,

you can add another data series to the chart, and send that data series to the secondary axis. Change the chart type to XY Scatter chart and point it to two data pairs for X and Y respectively:

X = 0, Y=calculated value
X= 1, Y=calculated value

That's your 40% line. The "calculated value" is a single cell in your spreadsheet where you use a formula to figure out the desired number

Add another series to the chart for the 60% line. This one will automatically sit on the secondary axis. Point it to a the cells for X and Y.

Make sure that the two Y axes have the same maximum settings. This can be achieved with another data series on the secondary axis, just one data point with the maximum value of the data on the primary axis.

Set the secondary X axis maximum value to 1 and hide the display of the secondary X axis.

See attached.

cheers, teylyn
Book1.xlsx
0

Author Comment

ID: 37799609
Hi Teylyn,

thank you for your response, very useful. The base data series will be expanding everyday as new pricing is fed through. How would I cater for this?

Cheers,
Duncan
0

Author Comment

ID: 37799625
Sample file attached
Market-Feed.xlsx
0

LVL 50

Expert Comment

ID: 37799707
I'm busy for the next three hours, but will look at this thereafter.

For changing data ranges you can employ dynamic range names to feed the chart. It's easy to set up and low maintenance.

I'll be back with a suggestion in a few hours unless someone else chips in first.

Cheers, teylyn
0

LVL 50

Expert Comment

ID: 37800366
Hi again,

I'm having trouble with my Excel version right now. Here is a verbal run-down to set up the FTSE chart.

Somewhere on the FTSE sheet, enter the formula

=INDEX('FTSE 100'!E:E,MATCH(99^99,'FTSE 100'!E:E,1))

Then use a formula to calculate the 40% and 60% off that value. The rest is like I described in the comment above.

I'll try to get this going in your sample file when I'm back at a working Excel system in the morning

cheers, teylyn
0

LVL 43

Expert Comment

ID: 37802343
Enter your desired value in a blank column say column I all the way down to the end of the data.

Add a new series to the chart from column I.

See attached

*** edit ***

Failed to upload so uploaded at EE-stuff

https://filedb.experts-exchange.com/incoming/ee-stuff/8242-Market-Feed.xlsx

Looks like upload also succeeded so sending both.
Market-Feed.xlsx
0

LVL 50

Expert Comment

ID: 37803315
No, ssaqibh, no. Don't add another column of data. You only need 2 data points for a straight line, not 6000. That would blow up the already big file even bigger.
0

LVL 50

Accepted Solution

Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 1200 total points
ID: 37803954
Here is the file with the FTSE tab and the chart changes in place.
Market-Feed.xlsx
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calculâ€¦
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
###### Suggested Courses
Course of the Month4 days, 22 hours left to enroll

#### 670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.