+ Reply to Thread
Results 1 to 4 of 4

Align Zero of Primary Axis & Secondary Axis

  1. #1
    Registered User
    Join Date
    05-04-2023
    Location
    london
    MS-Off Ver
    2013
    Posts
    2

    Question Align Zero of Primary Axis & Secondary Axis

    Hi
    I have a set of data linked to a Cost Code and the graphs are shown as per the filtered cost code.
    On the primary Axis is the monthly Expense (Clustered Column) on the secondary axis is the Total Forecasted (Line).
    Problem is the secondary aixs ZERO is not aligning to Primary axis.
    Manually i can allign the axis. But i need help in aligning it automatic as soon as cost code is changed.

    Please let me know if the worksheet is need to be uploaded.
    Attached Images Attached Images

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

    Re: Align Zero of Primary Axis & Secondary Axis

    I'm not aware of any built in way to do this. I would expect to use something like this strategy: https://peltiertech.com/chart-udf-control-axis-scale/ It would need to be modified to read the primary axis scale properties and use those to calculate the desired values for the secondary axis scale, then write those values into the secondary axis scale properties.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    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: Align Zero of Primary Axis & Secondary Axis

    I agree with MrShorty on this. There is no Excel feature to do this automatically. A VBA solution would work.

    There may be a way to contrive your data to force them to match. That would involve adding a fake data point for the series on the right axis that has a y value calculated to align the 0 value with the 0 value on the left axis. But I can't advise on that without the file. Please see yellow banner at the top of the page.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    05-04-2023
    Location
    london
    MS-Off Ver
    2013
    Posts
    2

    Re: Align Zero of Primary Axis & Secondary Axis

    Thanks MrShorty.
    some deep searches into this forum gave me an excel sheet with a macro. It serves my purpose through a macro. though need to click the assigned macro button everytime i switch the code.
    Also ZERO is not shown on the axis but data are aligned (can live without that).
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 08-30-2022, 09:02 AM
  2. [SOLVED] Align primary and secondary x-axis in combination plot
    By jimjones1958 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-24-2020, 05:19 AM
  3. pivot with primary axis 2 tables as input and secondary axis the same unit?
    By Johan Tielens in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-19-2020, 04:52 PM
  4. Replies: 2
    Last Post: 10-08-2014, 08:04 PM
  5. Replies: 1
    Last Post: 10-08-2014, 06:36 PM
  6. Align Primary and Secondary Axis Dates W/O Flipping Columns?
    By clw496 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-02-2013, 06:46 PM

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