• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 762
  • Last Modified:

Excel 2010 Date Difference Formula

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
lcor
Asked:
lcor
  • 2
3 Solutions
 
SiddharthRoutCommented:
You don't need a macro. Put this formula in cell 3

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

Sid
0
 
AriMcCommented:
Let's say Cell1 is A1, Cell2 is B1 and Cell3 is C1

Then, in C1 you'd write:

=(B1-A1)>90

0
 
AriMcCommented:
Oops, got the comparison wrong, should be

=(B1-A1)<90
0
 
barry houdiniCommented:
Do you need a macro?

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

=B2-A2<90

regards, barry
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now