+ Reply to Thread
Results 1 to 14 of 14

Display data label: Number vs. %

  1. #1
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Display data label: Number vs. %

    I want to display either a % or a number based on the selection of an option button. My problem is with switching between the number format and % format. I have attached a test file.
    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-08-2005
    Location
    Kansas, USA
    MS-Off Ver
    2016
    Posts
    293

    Re: Display data label: Number vs. %

    The problem is that B18:B24 is formatted as Percent. Thus, even when you select PBIT, it is presented as a percentage. Suggest you format as a number, and multiply your percents by 100 to have them display properly.

    If you want to have the data displayed as percentages, then you probably need a macro to change the formatting of that range. You can easily record a macro to do the formatting, and then assign it to your option button. You'll need another for the other option as well.
    Last edited by gjcase; 07-29-2013 at 09:20 AM.

  3. #3
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Display data label: Number vs. %

    Thanks for your reply. I have written the macros and attached them to the option buttons & it works perfectly.

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

    Re: Display data label: Number vs. %

    You don't need code you can use named ranges to chart the selected values.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Display data label: Number vs. %

    Thanks Andy. Could you provide an example of that based on my test file?

  6. #6
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Display data label: Number vs. %

    I have attached my sample file with the macros.
    Attached Files Attached Files

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

    Re: Display data label: Number vs. %

    I alter the labelling of the options buttons so the store value makes the Offset named range work easier.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Display data label: Number vs. %

    That is so much simpler. Much appreciated.

  9. #9
    Forum Contributor
    Join Date
    08-08-2005
    Location
    Kansas, USA
    MS-Off Ver
    2016
    Posts
    293

    Re: Display data label: Number vs. %

    Hey, Andy, that's a neat trick. Thanks for the tip.

  10. #10
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Display data label: Number vs. %

    I understand the offset function. Can you explain the range for the chart? If I select the chart, I can't see the data range for the chart?

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

    Re: Display data label: Number vs. %

    Use the Select Data dialog to see the named range used.

  12. #12
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Display data label: Number vs. %

    It says the data range is too complicated to be displayed?

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

    Re: Display data label: Number vs. %

    I don't get that message anywhere.

    Use Formulas > Name Manager, to see the named range formula.
    If you select the columns the range used has a box around it.
    If you use Select Data you see the formula used to reference the named range

  14. #14
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Display data label: Number vs. %

    OK, I finally figured it out. Thanks for all your help.

+ 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. Display the last point's data label in series with VBA
    By cesna123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2010, 11:13 AM
  2. How do you display data in a label on a userform?
    By kryt0n in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 08-13-2010, 06:48 AM
  3. Display category name and Y value in data label
    By jeffreybrown in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 12-03-2009, 06:44 PM
  4. Display data using label on userform
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-27-2008, 04:39 PM
  5. How to Display a Moving Data Label
    By Protiusmime in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 10-11-2008, 03:31 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