+ Reply to Thread
Results 1 to 7 of 7

Why do I get a #Name error when I use the DateDif function?

  1. #1
    PhilS
    Guest

    Why do I get a #Name error when I use the DateDif function?

    I have used the =DateDif function in the past. I recently had to format my
    drive and reinstalled Office 2k. When I returned my application, all the
    cells using the =DateDif function returned a #Name error. Hope someone can
    assist. Thank you in advance.
    Phil

  2. #2
    Dave Peterson
    Guest

    Re: Why do I get a #Name error when I use the DateDif function?

    =datedif() in the worksheet
    datediff in VBA

    My bet it isn't your function (=datedif()), it's something else in the formula.

    You may want to post the whole formula if you can't isolate the problem.

    PhilS wrote:
    >
    > I have used the =DateDif function in the past. I recently had to format my
    > drive and reinstalled Office 2k. When I returned my application, all the
    > cells using the =DateDif function returned a #Name error. Hope someone can
    > assist. Thank you in advance.
    > Phil


    --

    Dave Peterson

  3. #3
    PhilS
    Guest

    Re: Why do I get a #Name error when I use the DateDif function?

    Here is the formula that I have been using for over two years.
    =DATEDIF("12/31/2004",(TODAY()),"d")
    I was using this with XLS 2000 through Office 2K with WIN 2K. I saved my
    application on disk, reformatted the drive, installed XP Pro. Then
    reinstalled Office 2000. Then brought my application back from disk to the
    Spreadsheet folder that I use and in every instance where the formula is
    located I get the #NAME error. On the same machine I also have Office 2003. I
    get the same error in both of the versions of office. Thanks again for your
    help.
    PhilS
    "Dave Peterson" wrote:

    > =datedif() in the worksheet
    > datediff in VBA
    >
    > My bet it isn't your function (=datedif()), it's something else in the formula.
    >
    > You may want to post the whole formula if you can't isolate the problem.
    >
    > PhilS wrote:
    > >
    > > I have used the =DateDif function in the past. I recently had to format my
    > > drive and reinstalled Office 2k. When I returned my application, all the
    > > cells using the =DateDif function returned a #Name error. Hope someone can
    > > assist. Thank you in advance.
    > > Phil

    >
    > --
    >
    > Dave Peterson
    >


  4. #4
    Dave Peterson
    Guest

    Re: Why do I get a #Name error when I use the DateDif function?

    It always scares me when I see dates as strings.

    I'd use this:
    =DATEDIF(DATE(2004,12,31),TODAY(),"d")

    Just in case the windows regional settings for short dates wasn't mdy.

    But when I changed my windows regional settings, I got a #value! error with your
    original formula.

    Another international question...

    Are you sure that "D" is the correct representation for Day in your installed
    version of excel. (difficult to guess where you're located).

    Heck, maybe =datedif() is different in your installed language.

    If you do this:
    hit alt-f11 to get to the VBE
    hit ctrl-g to see the immediate window
    type this and hit enter:
    range("a1").formula = "=DATEDIF(DATE(2004,12,31),TODAY(),""d"")"

    what formula do you see in A1 of that activesheet?



    PhilS wrote:
    >
    > Here is the formula that I have been using for over two years.
    > =DATEDIF("12/31/2004",(TODAY()),"d")
    > I was using this with XLS 2000 through Office 2K with WIN 2K. I saved my
    > application on disk, reformatted the drive, installed XP Pro. Then
    > reinstalled Office 2000. Then brought my application back from disk to the
    > Spreadsheet folder that I use and in every instance where the formula is
    > located I get the #NAME error. On the same machine I also have Office 2003. I
    > get the same error in both of the versions of office. Thanks again for your
    > help.
    > PhilS
    > "Dave Peterson" wrote:
    >
    > > =datedif() in the worksheet
    > > datediff in VBA
    > >
    > > My bet it isn't your function (=datedif()), it's something else in the formula.
    > >
    > > You may want to post the whole formula if you can't isolate the problem.
    > >
    > > PhilS wrote:
    > > >
    > > > I have used the =DateDif function in the past. I recently had to format my
    > > > drive and reinstalled Office 2k. When I returned my application, all the
    > > > cells using the =DateDif function returned a #Name error. Hope someone can
    > > > assist. Thank you in advance.
    > > > Phil

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

  5. #5
    Dave Peterson
    Guest

    Re: Why do I get a #Name error when I use the DateDif function?

    And Kassie brings up another good point.

    Do you have a macro or a name (like a range name) or a module name of DateDif.
    If you do (or did), maybe you're confusing excel.

    Does the formula work in a brand new workbook?

    Does the formula work in a brand new workbook when you start excel in safe mode?

    close excel
    windows start button|Run
    excel /safe

    type in your formula and see what happens????

    PhilS wrote:
    >
    > Here is the formula that I have been using for over two years.
    > =DATEDIF("12/31/2004",(TODAY()),"d")
    > I was using this with XLS 2000 through Office 2K with WIN 2K. I saved my
    > application on disk, reformatted the drive, installed XP Pro. Then
    > reinstalled Office 2000. Then brought my application back from disk to the
    > Spreadsheet folder that I use and in every instance where the formula is
    > located I get the #NAME error. On the same machine I also have Office 2003. I
    > get the same error in both of the versions of office. Thanks again for your
    > help.
    > PhilS
    > "Dave Peterson" wrote:
    >
    > > =datedif() in the worksheet
    > > datediff in VBA
    > >
    > > My bet it isn't your function (=datedif()), it's something else in the formula.
    > >
    > > You may want to post the whole formula if you can't isolate the problem.
    > >
    > > PhilS wrote:
    > > >
    > > > I have used the =DateDif function in the past. I recently had to format my
    > > > drive and reinstalled Office 2k. When I returned my application, all the
    > > > cells using the =DateDif function returned a #Name error. Hope someone can
    > > > assist. Thank you in advance.
    > > > Phil

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

  6. #6
    PhilS
    Guest

    Re: Why do I get a #Name error when I use the DateDif function?

    You are correct. Your suggestion worked immediately. Thank you very much.
    PhilS

    "Dave Peterson" wrote:

    > It always scares me when I see dates as strings.
    >
    > I'd use this:
    > =DATEDIF(DATE(2004,12,31),TODAY(),"d")
    >
    > Just in case the windows regional settings for short dates wasn't mdy.
    >
    > But when I changed my windows regional settings, I got a #value! error with your
    > original formula.
    >
    > Another international question...
    >
    > Are you sure that "D" is the correct representation for Day in your installed
    > version of excel. (difficult to guess where you're located).
    >
    > Heck, maybe =datedif() is different in your installed language.
    >
    > If you do this:
    > hit alt-f11 to get to the VBE
    > hit ctrl-g to see the immediate window
    > type this and hit enter:
    > range("a1").formula = "=DATEDIF(DATE(2004,12,31),TODAY(),""d"")"
    >
    > what formula do you see in A1 of that activesheet?
    >
    >
    >
    > PhilS wrote:
    > >
    > > Here is the formula that I have been using for over two years.
    > > =DATEDIF("12/31/2004",(TODAY()),"d")
    > > I was using this with XLS 2000 through Office 2K with WIN 2K. I saved my
    > > application on disk, reformatted the drive, installed XP Pro. Then
    > > reinstalled Office 2000. Then brought my application back from disk to the
    > > Spreadsheet folder that I use and in every instance where the formula is
    > > located I get the #NAME error. On the same machine I also have Office 2003. I
    > > get the same error in both of the versions of office. Thanks again for your
    > > help.
    > > PhilS
    > > "Dave Peterson" wrote:
    > >
    > > > =datedif() in the worksheet
    > > > datediff in VBA
    > > >
    > > > My bet it isn't your function (=datedif()), it's something else in the formula.
    > > >
    > > > You may want to post the whole formula if you can't isolate the problem.
    > > >
    > > > PhilS wrote:
    > > > >
    > > > > I have used the =DateDif function in the past. I recently had to format my
    > > > > drive and reinstalled Office 2k. When I returned my application, all the
    > > > > cells using the =DateDif function returned a #Name error. Hope someone can
    > > > > assist. Thank you in advance.
    > > > > Phil
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    > --
    >
    > Dave Peterson
    >


  7. #7
    Dave Peterson
    Guest

    Re: Why do I get a #Name error when I use the DateDif function?

    Just curious. Which one???



    PhilS wrote:
    >
    > You are correct. Your suggestion worked immediately. Thank you very much.
    > PhilS
    >
    > "Dave Peterson" wrote:
    >
    > > It always scares me when I see dates as strings.
    > >
    > > I'd use this:
    > > =DATEDIF(DATE(2004,12,31),TODAY(),"d")
    > >
    > > Just in case the windows regional settings for short dates wasn't mdy.
    > >
    > > But when I changed my windows regional settings, I got a #value! error with your
    > > original formula.
    > >
    > > Another international question...
    > >
    > > Are you sure that "D" is the correct representation for Day in your installed
    > > version of excel. (difficult to guess where you're located).
    > >
    > > Heck, maybe =datedif() is different in your installed language.
    > >
    > > If you do this:
    > > hit alt-f11 to get to the VBE
    > > hit ctrl-g to see the immediate window
    > > type this and hit enter:
    > > range("a1").formula = "=DATEDIF(DATE(2004,12,31),TODAY(),""d"")"
    > >
    > > what formula do you see in A1 of that activesheet?
    > >
    > >
    > >
    > > PhilS wrote:
    > > >
    > > > Here is the formula that I have been using for over two years.
    > > > =DATEDIF("12/31/2004",(TODAY()),"d")
    > > > I was using this with XLS 2000 through Office 2K with WIN 2K. I saved my
    > > > application on disk, reformatted the drive, installed XP Pro. Then
    > > > reinstalled Office 2000. Then brought my application back from disk to the
    > > > Spreadsheet folder that I use and in every instance where the formula is
    > > > located I get the #NAME error. On the same machine I also have Office 2003. I
    > > > get the same error in both of the versions of office. Thanks again for your
    > > > help.
    > > > PhilS
    > > > "Dave Peterson" wrote:
    > > >
    > > > > =datedif() in the worksheet
    > > > > datediff in VBA
    > > > >
    > > > > My bet it isn't your function (=datedif()), it's something else in the formula.
    > > > >
    > > > > You may want to post the whole formula if you can't isolate the problem.
    > > > >
    > > > > PhilS wrote:
    > > > > >
    > > > > > I have used the =DateDif function in the past. I recently had to format my
    > > > > > drive and reinstalled Office 2k. When I returned my application, all the
    > > > > > cells using the =DateDif function returned a #Name error. Hope someone can
    > > > > > assist. Thank you in advance.
    > > > > > Phil
    > > > >
    > > > > --
    > > > >
    > > > > Dave Peterson
    > > > >

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

+ 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