+ Reply to Thread
Results 1 to 6 of 6

How to display a '0' value as "Nil"

  1. #1
    Registered User
    Join Date
    08-26-2011
    Location
    Alberta
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to display a '0' value as "Nil"

    If my calculated value = 0, I need the cell to say "NIL". If it is any value other than 0, then it has to be that calculated number. How can I do this?

    Thanks in advance!
    Last edited by Angelena; 08-26-2011 at 01:32 PM.

  2. #2
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: How to display a '0' value as "Nil"

    =IF (formula=0,"NIL",formula)

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to display a '0' value as "Nil"

    You can format the cells to show that.

    Select the cells, right-click and select Format Cells. In the Number tab select Custom and enter: 0;-0;"Nil";@ in the type field.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    08-26-2011
    Location
    Alberta
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to display a '0' value as "Nil"

    NBVC: So if I need the numbers to be in the Accounting format with two decimal places, how do I add that on to the custom format you gave me? Thank you so much!

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to display a '0' value as "Nil"

    The easiest way is to go to Number tab, select Accounting, and play with the decimals and any symbol you want, then select Custom, this should show the code for the Accounting you selected... just replace the portion between the 3rd and 4th semicolons with "Nil"

  6. #6
    Registered User
    Join Date
    08-26-2011
    Location
    Alberta
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to display a '0' value as "Nil"

    THANKS NBVC!!!! That worked.

+ 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