+ Reply to Thread
Results 1 to 10 of 10

how to make cell display something else for zero value?

  1. #1
    Forum Contributor juntjoo's Avatar
    Join Date
    02-29-2008
    Location
    Cape Coral, FL
    MS-Off Ver
    Excel 2010 14.04.4760.1000
    Posts
    472

    how to make cell display something else for zero value?

    Please Login or Register  to view this content.
    If the cell it references on this other sheet doesn't happen to have anything in it, it displays zero. I'd rather it display something else that I tell it to in the event the cell is empty. I was thinking 'if(reference formula, returns nothing, then "- - -", otherwise reference formula)' which is repetitive thus long/inefficient for my taste. Was hoping there was an easier way to do this. Thanks
    Excel 1.0.1 (16.0.14326.20140) (Android)
    Excel 2010 14.04.4760.1000

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: how to make cell display something else for zero value?

    You can use custom number format

    Something like... #,##0.00;-#,##0.00;"---";@

  3. #3
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: how to make cell display something else for zero value?

    2 options:
    1. Format it with a custom format like
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    2. Replace the blank cells with a blank. Put ="" in a cell, and then copy and paste as values. Now use that cell to replace you blank cells so they have a BLANK in them.

    If you want cells that actually have a 0 in them to be "- - -" use #1. If you don't, then #2.
    1. Include a sample workbook with an example of the result you want
    2. Use [CODE] and [FORMULA] wrappers for your VBA code or excel formulas
    3. If your question has been answered, mark the thread as SOLVED and click on the "Add Rep" star to thank whoever helped you.

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: how to make cell display something else for zero value?

    you could use an IF to do it as well,


    Please Login or Register  to view this content.

    Edit: didn't read whole post.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  5. #5
    Forum Contributor juntjoo's Avatar
    Join Date
    02-29-2008
    Location
    Cape Coral, FL
    MS-Off Ver
    Excel 2010 14.04.4760.1000
    Posts
    472

    Re: how to make cell display something else for zero value?

    Thanks. what do all those symbols mean?

    and how would I do this for a cell formatted for dates?

    Thanks

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,967

    Re: how to make cell display something else for zero value?

    Quote Originally Posted by juntjoo View Post
    ... how would I do this for a cell formatted for dates?
    Tested with version 2010 so I am only guessing that it would work for version 2007. Example of custom formatting that would display a date such as 1/1/2017 or, if the the source cell is blank, - - -
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Forum Contributor juntjoo's Avatar
    Join Date
    02-29-2008
    Location
    Cape Coral, FL
    MS-Off Ver
    Excel 2010 14.04.4760.1000
    Posts
    472

    Re: how to make cell display something else for zero value?

    Quote Originally Posted by JeteMc View Post
    Tested with version 2010 so I am only guessing that it would work for version 2007. Example of custom formatting that would display a date such as 1/1/2017 or, if the the source cell is blank, - - -
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Thanks. just tell me how it works so I don't have to keep asking this question in the future if you don't mind. How would I do it for ex. to have it blank if zero rather than the three hyphens? Thanks

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,805

    Re: how to make cell display something else for zero value?

    What it's saying is if the contents of the cell are in the format m/d/yyyy, then display the date. If not, display three hyphens.

    Try changing it to this:

    m/d/yyyy;m/d/yyyy;""
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: how to make cell display something else for zero value?

    Or try this ...

    =IFERROR(1/(1/VLOOKUP(…...)),"")

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,967

    Re: how to make cell display something else for zero value?

    Another option for displaying a blank when VLOOKUP finds a zero value would be m/d/yyyy;;""
    Excel stores dates as numbers and the options for custom formats follow the pattern postive format;negative format;zero format
    Put the desired display format for positive numbers in front of the semi colon, format for negative numbers between semi colons and format for zero after the second semi colon. Since dates aren't negative you can leave that portion of the format unfilled.
    Let us know if you have any questions.

+ 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. [SOLVED] Can I make a cell display something if any date in a row is before today?
    By Deathwing in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-10-2014, 04:46 PM
  2. How to make : if ( sum of cells)<422.10 then display in this cell 422.10
    By p.ocho in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2014, 04:42 AM
  3. trying to make a cell display results from other.
    By jediknight in forum Excel General
    Replies: 6
    Last Post: 07-29-2010, 06:57 AM
  4. make a cell display warning if
    By stevecontracts in forum Excel General
    Replies: 5
    Last Post: 01-26-2010, 08:37 AM
  5. How to make a shape display when a cell is click.
    By romancebao in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2009, 05:00 PM
  6. How to make a shape display when a cell is click.
    By romancebao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2009, 03:38 PM
  7. How to make a shape display when a cell is click.
    By romancebao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2009, 03:10 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