+ Reply to Thread
Results 1 to 4 of 4

Return Blank Cells Instead of Zeros

  1. #1
    Registered User
    Join Date
    04-11-2020
    Location
    London
    MS-Off Ver
    2019
    Posts
    8

    Return Blank Cells Instead of Zeros

    Hi.

    =DATEDIF(A2,B2,"D") is returning the number of days that have passed between two dates
    e.g.

    A2=01/01/2021
    B2=07/01/2021
    = 6 days



    If B2 is empty, a "-" (hyphen) is returned, e.g.

    =IFERROR(DATEDIF(A2,B2,"D"),"-")


    But empty cells in both column A and column B that have not yet had any dates entered are returning a zero e.g. '0'

    I would like these cells to return a blank until at least a date in column A is entered?


    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,109

    Re: Return Blank Cells Instead of Zeros

    How about
    =IF(SUM(A2:B2)=0,"",IFERROR(DATEDIF(A2,B2,"D"),"-"))

  3. #3
    Registered User
    Join Date
    04-11-2020
    Location
    London
    MS-Off Ver
    2019
    Posts
    8

    Re: Return Blank Cells Instead of Zeros

    Many thanks

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,109

    Re: Return Blank Cells Instead of Zeros

    You're welcome & thanks for the feedback.

+ 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] Cells in a range are all not blank, return maximum value (date), If 1 blank return 0
    By Matt1998 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-19-2016, 11:14 AM
  2. Blank Cells & Zeros
    By STBTC in forum Excel General
    Replies: 14
    Last Post: 01-06-2016, 01:55 AM
  3. Replies: 3
    Last Post: 11-22-2007, 07:53 AM
  4. Blank Cells Plotting as Zeros
    By ChristiaanV in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-13-2006, 11:31 PM
  5. Replies: 1
    Last Post: 10-13-2005, 09:39 AM
  6. blank cells v. zeros
    By JessNY in forum Excel General
    Replies: 1
    Last Post: 08-05-2005, 03:05 PM
  7. [SOLVED] Replacing blank cells with zeros
    By Ben in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2005, 05:08 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