+ Reply to Thread
Results 1 to 15 of 15

Primary and Secondary Axis

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    16

    Primary and Secondary Axis

    Is there any setting that could be used to set the zeros of both primary and seconday axis set in the same horizon?

    Thanks!

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Primary and Secondary Axis

    Hi Ceciwong,

    Welcome to the forum.

    I guess there is an option of starting horizontal / vertical axis... as "horizontal axis crosses" and "vertical axis crosses" where you can set them to start from zero. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    08-15-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Primary and Secondary Axis

    thank you for your answer, but i mean to set the zeros of the two vertical axis (the left and the right one) to be on the same line so that it could be easier to compare the positive and negative figures. is it possible?

    Thanks

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Primary and Secondary Axis

    Could you share a sample image of the chart that you are looking for ?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    08-15-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Primary and Secondary Axis

    sample chart.jpg

    from the file, you could see the zero in the left axis is lower than that in the right axis. could there be any way to set them on the same line? thanks

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

    Re: Primary and Secondary Axis

    Cheers
    Andy
    www.andypope.info

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Primary and Secondary Axis

    Hi Ceciwong,

    I tried that and it worked.. see the attached if this is what you were looking for. Thanks.




    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Attached Files Attached Files

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

    Re: Primary and Secondary Axis

    @DILIPandey, take a closer look at the zero position of both Y axes, they are not aligned exactly.

    The attached contains your original chart and I have coloured the primary and secondary axes so you can see the gap more clearly.

    The second chart uses the suggested algorithm to correctly align the zeros.
    Attached Files Attached Files

  9. #9
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Primary and Secondary Axis

    thanks Andy.. I know you are chart Guru


    regards,
    DILIPandey

    <click on below 'star' if this helps>

  10. #10
    Registered User
    Join Date
    08-15-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Primary and Secondary Axis

    thank you very much. but i want both zero lines are coincided so that comparing the two charts' positive and negative values will be much more easier. but once again thank you very much.

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

    Re: Primary and Secondary Axis

    did you check my example file?

  12. #12
    Registered User
    Join Date
    08-15-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Primary and Secondary Axis

    Dear Andy, thank you very much. which macro should i run? do i need to run all 4 of them? when to run it? should i stay in the datafile or the chart to run the macro? thanks a lot.

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

    Re: Primary and Secondary Axis

    Did you read the article?

    "The following code includes four small procedures that invoke a larger one, depending which of the four relevant axis parameters you will allow to vary to make it work."

    Select the chart to be affected and run 1 or all, your choice.

  14. #14
    Registered User
    Join Date
    08-15-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Primary and Secondary Axis

    thanks a lot. can i copy your marco into my excel file?

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

    Re: Primary and Secondary Axis

    It's actually Jon Peltier's code but yes it is available for public use.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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