+ Reply to Thread
Results 1 to 4 of 4

Date looks funny!

  1. #1
    Registered User
    Join Date
    02-13-2006
    Posts
    10

    Date looks funny!

    I have a spreadsheet whereby in column G the user inputs a date and column H contains the formula

    =IF(G1>0,YEAR(G1),"")

    However, I need the user to be able to enter the date in column G as dd/mm/yyyy OR yyyy

    Column H needs to display yyyy

    This works fine if the user is only able to enter dd/mm/yyyy in column G and this column has been set up to recognise the contents as a Date in that format. However, if the user, for example enters 2008 in column G, then column H reads 1905 - please help!

  2. #2
    Registered User
    Join Date
    12-09-2003
    Posts
    12

    The problem is the value in ...

    IF(G1>0,YEAR(G1),"")

    Excel uses the Windows date convention (day 1 = Jan 1, 1900, Day 2 = Jan 2 1900, ... today (Feb 19, 2006) = 38768.

    Try making the "IF(G1>0,YEAR(G1),"")" into

    IF(G1>30000,YEAR(G1),G1)

  3. #3
    Roger Govier
    Guest

    Re: Date looks funny!

    Hi
    Try
    =IF(G1="","",IF(G1<2100,G1,YEAR(G1)))

    --
    Regards

    Roger Govier



    ajames wrote:
    > I have a spreadsheet whereby in column G the user inputs a date and
    > column H contains the formula
    >
    > =IF(G1>0,YEAR(G1),"")
    >
    > However, I need the user to be able to enter the date in column G as
    > dd/mm/yyyy OR yyyy
    >
    > Column H needs to display yyyy
    >
    > This works fine if the user is only able to enter dd/mm/yyyy in column
    > G and this column has been set up to recognise the contents as a Date
    > in that format. However, if the user, for example enters 2008 in
    > column G, then column H reads 1905 - please help!




  4. #4
    Registered User
    Join Date
    02-13-2006
    Posts
    10

    Talking Thanks

    A big thank-you, it works!

+ 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