title: How do I convert Oracle internal date to Excel date in Excel?
body: <p>I have a .csv file which was captured from an Oracle database. The date in the .csv file is in the Oracle internal format (not sure what it's called as I'm not familiar with Oracle). It looks like <code>16474</code></p>
  
  <p>When I look at that date in the app we use to access the DB, the date is <code>2/6/2013</code>.</p>
  
  <p>However, when I import the .csv file into Excel and format the column as Short Date, it shows the date as <code>2/6/1945</code></p>
  
  <p>I did a random sampling, and it looks like the month/day is always correct, but the year is off by 68 years. I'm assuming this is because Oracle's "beginning of time" is different than Excel's "beginning of time"</p>
  
  <p>Any way to fix this so the dates show properly when importing the Oracle data into Excel?</p>
  
  <p>I don't have access to anything on the Oracle side .. just the .csv file, and Excel. I'm also ultimately importing the Excel file into Access if that helps. </p>
  
  <p>So far, I formatted the Oracle date as Short Date in Excel, and inserted a column next to my date column (J) and used the following:</p>
  
  <pre><code>=DATE(YEAR(J1)+68,MONTH(J1),DAY(J1))
  </code></pre>
  
  <p>I'm not sure if that is 100% accurate considering leap years</p>
  
  <p>EDIT: I think this code may do it:</p>
  
  <pre><code>Public Sub ReplaceData()
  
      Dim RangeCell As Range
  
      For Each RangeCell In Selection
  
          If IsNumeric(RangeCell.Value) Then
              lngDate = CLng(RangeCell.Value)
              RangeCell.Value = DateAdd("d", lngDate - 1, "1/1/1968")
          End If
  
      Next RangeCell
  
  End Sub
  </code></pre>