Brothersoft.comWindows|Mac|Mobile|Games

|Message

Solve software problem quickly Share experience to help others Improve the ability of solving problem
Tags:
How to Use Datediff in Excel

11/03/2011 01:22 by JohnEverard

First answer posted by JavyTechGuy at 11/03/2011 01:22
Add Your Answer
10~1000 characters in length CAPTCHA:
2 Answers
  • JavyTechGuy
    1. Click the Windows "Start" button and select "All Programs." Click "Microsoft Office," then click "Microsoft Excel" to start the program.

    2. Press the "Ctrl" and "O" keys on the computer. In the opened dialog window, double-click the file you want to edit. Click the cell where you want the results of the "DateDiff" function to appear.

    3. Click the "Developer" ribbon tab at the top of the Excel window. Click the "Visual Basic" button to open the VBA editor. Double-click "Sheet1" to open the editor to the current sheet.

    4. Type the following code in the editor:

      Function GetDifference (myDate1 as Date, myDate2 as Date) as Long

      GetDifference = DateDiff("d", myDate1, myDate2)

      End Function

    5. Click the "Save" button, then close the VBA editor. Type "=GetDifference(A2, A1)" and press "Enter." Replace "A2" and "A1" with the cells that contain the dates you want to compare. Excel calls the VBA function and displays the date difference in days.

  • Was this answer helpful? 00 · 11/03/2011 01:22
  • vikiying
  • Speaking of excel or word. .i have to admit that it has  brought us great convenience. so does excel barcode.i used it frequently. you can have a try. http://www.keepautomation.com/products/excel_barcode/

  • Was this answer helpful? 00 · 01/18/2012 22:59
Add Your Answer
10~1000 characters in length CAPTCHA:
Related Questions
Q:How to Calculate DateDiff in Access

A:Function Explanation Understand the DateDiff function. The DateDiff function uses the expression "=DateDiff (interval, date1, date2)" to cal...(more)

Q:How to Use DATEDIFF to Get the Age of a Person in Microsoft SQL 2005

A: Determine the start date and end date. To calculate a person's current age, use the birthday as the start date and the current date for the ...(more)

Q:How to Use SQL Parameters

A: Set up the query statement. Using the "?" signifies to the SQL Server that a parameter is used. The following statement queries the database...(more)

Q:How to Use DATEDIFF in SQL

A: Click the "Start" button. Navigate to the "Microsoft SQL Server" folder appropriate to the installed version, and then click on "SQL Server ...(more)

Q:How to Backup a Database Using SQL 2005 Express

A: Click the Windows "Start" button. Click "All Programs," then click "SQL Server Express" and then click "SQL Server Management Studio." This ...(more)

1 people are following

Ask a question now
Write a title for your question

Navicat MySQL Manager Lite

Navicat (MySQL Manager - a GUI for MySQL admin and Access to MySQL conversion)
Latest version:8.2.19
License:Freeware
OS:Windows 7/Vista/2003/XP/2000/2008
Total downloads:71,596
Rank:5 in Database Management
Download It

Share with friends

New features is coming

  • 1. Providing high-quality answers to be a verified Q&A expert
  • 2. Ask and answer questions to get Brothersoft credits

Added Successfully!

×

Are you sure to delete your answer?

NoYes

×

Are you sure to choose it as the best answer?

NoYes

×

Voted Successfully!

×

You can't vote for yourself

×

You can't choose your own answer

×