+ Reply to Thread
Results 1 to 5 of 5

How do I create a formula to return a blank cell if false?

  1. #1
    Registered User
    Join Date
    10-22-2007
    Posts
    5

    How do I create a formula to return a blank cell if false?

    Hi there

    I have been trying to create an IF statement that returns a blank cell if there is no date in A1. It does the calculation if I use the following formula =DATEDIF(A16,TODAY(),"D")/7 however if I fill down with this formula the rows that have no dates in them become 5626 days. I want it to be left blank if the date has not yet been entered. I usually put ,"") at the end but have tried all variations and nothing seems to work.

    I would be very grateful if somebody could help.

    Many thanks
    Vivecat

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(A16="","",DATEDIF(A16,TODAY(),"D")/7)
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-22-2007
    Posts
    5

    Smile

    I've put in the formula but is returning with VALUE?? I've attached the file as I have validations in these cells as well and it may be why it is not working. I am trying to fully automate the worksheet for others who do not have any excel knowledge to use.

    Apart from this previous formula not working I also want the row to hide once the file has been closed if a name is typed into the allocation column. I have. I think, filtered it on only showing blanks but when I close it and reopen the row it is still there.

    Do you know what I maybe doing wrong.

    many thanks
    Vivecat
    Attached Files Attached Files

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Noob's formula works fine; maybe you put it in the wrong row.

    Also, you don't need the DATEDIF function to find the difference in days; just subtract. Put this formula in F2 and copy down:

    =IF(A2="", "", (TODAY() - A2) / 7 )

  5. #5
    Registered User
    Join Date
    10-22-2007
    Posts
    5

    Smile

    Your right. I must have done something wrong.

    Many thanks to both of you for your help on this.

    kind regards
    Vivecat

+ 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