How to format negative values on chart axes?

Varad Sadre 0 Reputation points
2025-08-07T15:44:50.05+00:00

I have configured the Number format for the chart axis as [>999999999]\$#.00,,,"B";[>999999] \$#.00,,"M"; \$#.00, which correctly displays positive values. However, assistance is needed in handling negative values since I'm unable to add more conditional formats due to the character limit in the Format Code. User's image

Microsoft 365 and Office | Excel | For business | Windows
{count} votes

3 answers

Sort by: Most helpful
  1. Jay Tr 1,060 Reputation points Microsoft External Staff Moderator
    2025-08-07T16:04:51.03+00:00

    Hi @Varad Sadre,

    Good day to you! Welcome to Microsoft Q&A.

    Regarding to your question, could you please upload the Excel file to OneDrive and share it with Edit permission, then reply with the link so that I can edit it directly. Moreover, please let me know how you would like the negative numbers to be formatted.

    Looking forward to your response.

     


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.     

    image


  2. Jay Tr 1,060 Reputation points Microsoft External Staff Moderator
    2025-08-07T18:10:56.7833333+00:00

    Hi @Varad Sadre,

    Thank you for the confirmation. To apply a custom number format in Excel that automatically adjusts for both positive and negative values across a wide range from hundreds to trillions, please follow the steps below: 

    1. Select the cells or chart axis you want to format. 
    2. Open the Format dialog:  
    • For cells: Right-click the selected cells and choose Format Cells. 
    • For chart axis: Right-click the axis and choose Format Axis, then expand the Number section. 
    1. Choose “Custom” from the category list. 
    2. Paste the following format code into the Type field:  

    [>=1000000000000]$#,##0.00,,,"T";[>=1000000000]$#,##0.00,,,"B";[>=1000000]$#,##0.00,,,"M";[>=1000]$#,##0.00,,"K";[<=-1000000000000]-$#,##0.00,,,"T";[<=-1000000000]-$#,##0.00,,,"B";[<=-1000000]-$#,##0.00,,,"M";[<=-1000]-$#,##0.00,,"K";- $#,##0.00   

    1. Click “OK” (or “Add” if formatting a chart axis) to apply the format. 

      

    If you have any further questions and concerns, please don’t hesitate to ask. Looking forward to your response. 

     


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.     

    image


  3. Jay Tr 1,060 Reputation points Microsoft External Staff Moderator
    2025-08-09T22:51:43.5133333+00:00

    Hi @Varad Sadre

    Thank you for the response. Excel allows custom number formatting in chart axis labels, but it has strict limitations. Specifically, the format code field for chart axes has a character limit, and it only supports a single format section. This means complex formats with multiple conditions—such as those that apply different suffixes for millions and billions, or treat negative values differently—may not be accepted. 

    If you're seeing an error like “entry may contain no more than 0 characters,” it's likely because the format code you're trying to use exceeds Excel’s internal limit for that field. 

    What you can do: 

    • Use a simple format code that applies uniformly to all values. For example:  
      • $0.00,,,"M" — shows values in millions 
      • $0.00,,,,"B" — shows values in billions 
    • If you need dynamic formatting (e.g., showing K for thousands, M for millions, B for billions), we recommend using a helper column with a formula like this: 
    =IF(ABS(A2)>=1E12,TEXT(A2/1E12,"$0.00")&"T", 
     IF(ABS(A2)>=1E9,TEXT(A2/1E9,"$0.00")&"B", 
     IF(ABS(A2)>=1E6,TEXT(A2/1E6,"$0.00")&"M", 
     IF(ABS(A2)>=1E3,TEXT(A2/1E3,"$0.00")&"K", 
     TEXT(A2,"$0.00"))))) 
    

     

    You can then use this column as data labels in your chart to simulate dynamic suffix formatting. 

    This is the final result:  

     User's image

    If you need help applying this workaround or adapting it to your specific chart, feel free to ask.

     


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.     

    image 


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.