?
Solved

Excel 2010 Date Difference Formula

Posted on 2011-02-11
4
Medium Priority
?
753 Views
Last Modified: 2012-05-11
Does anyone know how to do the following:

Cell 1      Cell 2      Cell3
-------      ------       -----
Date1       Date2     Result

The macro needs to do following:  Take the difference between Date1 and Date2, where Date2 is farther out.  The Result is true if the difference in dates in number of days is less than a specific number (say, 90).
0
Comment
Question by:lcor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 1600 total points
ID: 34873398
You don't need a macro. Put this formula in cell 3

=IF(B1-A1<90,"True","False")

Sid
0
 
LVL 9

Expert Comment

by:AriMc
ID: 34873400
Let's say Cell1 is A1, Cell2 is B1 and Cell3 is C1

Then, in C1 you'd write:

=(B1-A1)>90

0
 
LVL 9

Assisted Solution

by:AriMc
AriMc earned 200 total points
ID: 34873415
Oops, got the comparison wrong, should be

=(B1-A1)<90
0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 200 total points
ID: 34873432
Do you need a macro?

If dates are in A2 and B2 try a formula in C2

=B2-A2<90

regards, barry
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question