+ Reply to Thread
Results 1 to 10 of 10

Blank Date

  1. #1
    Registered User
    Join Date
    09-12-2014
    Location
    Norman
    MS-Off Ver
    2010
    Posts
    37

    Cool Blank Date

    I have a spreadsheet that looks for its data from sheet 1.
    One of the columns is a date not all rows contain a date.
    I formulate such that the data is copied to new sheet based on certain criteria

    Please Login or Register  to view this content.
    When I reference from this column it correctly puts the date in, but for cells where there is no date it shows 01/00/1900

    I would like the cell to remain blank and not give me this 00/01/1900 date.

    Also, I want to find number of months between two formulated cells(test date - discovered date) in this sheet 2. So, I took a new column and put this below formula

    Please Login or Register  to view this content.
    but, when I find difference between a blank cell in test date and discovered date I would like to see number of months between today and discovered date.

    Thank you,

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Blank Date

    Perhaps this for the 1st part...

    =IF(INDEX(sheet1!P$2:P$5000,SMALL(IF(sheet1!$B$2:$B$5000="3rdParty",ROW(sheet1!$B$2:$B$5000)-ROW(sheet1!$B$2)+1),ROWS(D$2:D2)))="","",IFERROR(INDEX(sheet1!P$2:P$5000,SMALL(IF(sheet1!$B$2:$B$5000="3rdParty",ROW(sheet1!$B$2:$B$5000)-ROW(sheet1!$B$2)+1),ROWS(D$2:D2))),"")

    ANd for the 2nd...
    =(YEAR(D2)-IF(C2="",0,YEAR(C2)))*12+MONTH(D2)-IF(C2="",0,MONTH(C2))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-12-2014
    Location
    Norman
    MS-Off Ver
    2010
    Posts
    37

    Re: Blank Date

    @FDibbins - Thank you for getting back to me. The 1st part seemed to work good, however the second formula for finding the difference works just like my formula. It is able to find number of months between test date and discovered date. This formula is still displaying #value error for cells which has blank test cell - discovered date. For such case I want to find difference between Today and discovered date.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Blank Date

    For such case I want to find difference between Today and discovered date.
    Sorry, missed that part....
    =(YEAR(D2)-IF(C2="",YEAR(TODAY()),YEAR(C2)))*12+MONTH(D2)-IF(C2="",MONTH(TODAY(),MONTH(C2))

    If you are using this in many cells, it might be better to put the date in its own cell and then reference it.

    Can you give a few examples of the dates you are using, and what answers you want?

  5. #5
    Registered User
    Join Date
    09-12-2014
    Location
    Norman
    MS-Off Ver
    2010
    Posts
    37

    Thumbs up Re: Blank Date

    Please look at the attached sample datasheet. In sheet 2 I am making modifications like updating data from sheet 1 for all 3rd party applications. There corresponding Status, Severity, Discovery date, Re-test date and formulate number of months and Cycle.

    I want to find number of months between discovered date and re-test date for all closed applications and number of months between today and discovered date for all Open applications. Some Open status applications have re-test date but as they r not yet resolved I want to find months between today and discovered.

    I am afraid I have confuse you. Please let me know if my words dint mean anything to you.

    Thank you,

    -Sai

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Blank Date

    I think this might be a better formula for you...
    =DATEDIF(D2,IF(E2="",TODAY(),E2),"m")

    You will note that row 5 and 6 you get 9 and that formula gives you 8. Your 2 dates are 07/16/12 and 04/06/13 so you dont really have 9 months difference until 04/16/13

  7. #7
    Registered User
    Join Date
    09-12-2014
    Location
    Norman
    MS-Off Ver
    2010
    Posts
    37

    Re: Blank Date

    I appreciate your help Sir!! and Well, That should be a major problem because I am taking first 9 months as 1 cycle. My other concern is you see the blank cells below row 26. I dragged the formula downwards and this gives #Num! error. Any suggestion on that??

  8. #8
    Registered User
    Join Date
    09-12-2014
    Location
    Norman
    MS-Off Ver
    2010
    Posts
    37

    Re: Blank Date

    @FDibbins - As I mentioned earlier, I have a specific task in calculating the number of months between Re-test date and Discovered date. If status is "Closed" in Column B then perform operation on Re-test date - Discovered date, but if status is "Open" then the number of months should be Today - discovery date.

    I know this might be a troublesome way to arrange, but can you suggest something.

    Thanks again.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Blank Date

    This should fix both problems..
    =IFERROR(DATEDIF(D2,IF(E2="",TODAY(),EOMONTH(E2,0)),"m"),"")

  10. #10
    Registered User
    Join Date
    09-12-2014
    Location
    Norman
    MS-Off Ver
    2010
    Posts
    37

    Re: Blank Date

    If status is "Closed" in Column B then perform operation on Re-test date - Discovered date, but if status is "Open" then the number of months should be Today - discovery date.
    @FDibbins - This formula solved a part of the problem. Let's see the other part this way, In Sheet2 I want to see Re-test date(Column E) only for "Closed" Re-check Status(Column B) and display a blank cell for "Open" Re-check Status.
    Last edited by Sai Prashanth; 10-13-2014 at 11:03 AM.

+ 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] If formula, if two cells are blank, return blank, if one has a date, subtract todays date
    By amthyst826 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-06-2014, 12:47 PM
  2. Replies: 5
    Last Post: 05-29-2013, 12:27 AM
  3. Replies: 1
    Last Post: 10-02-2012, 02:42 PM
  4. How do I make a blank cell with a date format blank?
    By Re: Pivot Table/Query in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] How do I make a blank cell with a date format blank?
    By Re: Pivot Table/Query in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Tags for this Thread

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