+ Reply to Thread
Results 1 to 9 of 9

Simple Date Query 00/01/1900

  1. #1
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    Simple Date Query 00/01/1900

    Hi,

    Prob a real simple one, but im struggling a bit.

    I have a very simple vLOOKUP running between two sheets. I just want to pull the date from sheet 2. But there isnt a date in one of the cells, so it returns thedate value 00/01/1900. I would like it to either say 0 or be completly blank. Ideally blank though.

    From the report I run and input, if the site has not been brought on air there will not be a date, so I cant just manually put the 0 in otherwise that would defeat the object

    Many Thanks in advanced
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Simple Date Query 00/01/1900

    Try

    =IF(VLOOKUP(A2,Report!A1:B5,2,FALSE)=0,"",VLOOKUP(A2,Report!A1:B5,2,FALSE))

  3. #3
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Simple Date Query 00/01/1900

    When a Vlookup finds an empty cell, it will return a 0 as the result. That actually holds true for any formula.

    There are several approaches:

    1. Use an IF statement wrapped around the Vlookup. If it returns a 0, show an empty string, like this

    =IF(VLOOKUP(A2,Report!A1:B5,2,FALSE)=0,"",VLOOKUP(A2,Report!A1:B5,2,FALSE))

    2. If you don't like the double-up of the Vlookup, use a custom format that will not display zero values, for example

    d/mm/yyyy;;

    or

    mm/dd/yyyy;;

    This custom format will show a blank cell for 0 values.
    Like a post? Click the star below it!

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Simple Date Query 00/01/1900

    1. Use an IF statement wrapped around the Vlookup. If it returns a 0, show an empty string, like this

    For excel 2007 and higher you can use this one.

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Simple Date Query 00/01/1900

    Quote Originally Posted by oeldere View Post
    For excel 2007 and higher you can use this one.

    Please Login or Register  to view this content.
    That would only blank out errors not empty results where a match was found in the first column of the lookup, however

    Please Login or Register  to view this content.
    would work.

    @crispybadger

    Remember to use absulute references ($A$1) with your lookup table, or the range will move as you copy the formula down and leave you wondering why the results are not what you expect.

    VLOOKUP(A2,Report!$A$1:$B$5,2,FALSE)

  6. #6
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: Simple Date Query 00/01/1900

    Perfect!!

    But now I had another column which has another simple formula that was adding 10 days to the date. How do I keep this blank tto, until a date is input into the B column

    Thanks in advanced
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Simple Date Query 00/01/1900

    Try

    =IF(B2="","",B2+10)

  8. #8
    Forum Contributor
    Join Date
    07-03-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: Simple Date Query 00/01/1900

    Quote Originally Posted by jason.b75 View Post
    That would only blank out errors not empty results where a match was found in the first column of the lookup, however

    Please Login or Register  to view this content.
    would work.

    @crispybadger

    Remember to use absulute references ($A$1) with your lookup table, or the range will move as you copy the formula down and leave you wondering why the results are not what you expect.

    VLOOKUP(A2,Report!$A$1:$B$5,2,FALSE)
    Hi,

    Why would I want to keep absolute values? If I add further sites would I not want the cell values to change when I drag down the formula, thus allowing me to add more sites to the sheet??

    Many Thanks

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Simple Date Query 00/01/1900

    Yoes, but then the table only copies relative to the formula, if you look at the 3 formula in your sample workbook, the whole table moves down not just the end.

    If that is going to work for you then it suggest that the master will be an exact copy of the report, in which case why not just enter =Report!A3 in A2 of the master sheet then copy right and down, using conditional formatting to mask cells with a 0 value?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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