Link to home
Start Free TrialLog in
Avatar of singleton2787
singleton2787

asked on

YEARFRAC question

With this formula...is it possible to show when a date has been moved either forward or backwards with some method? Color-coding??
=YEARFRAC(I683,K683,1)*12
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Not sure what you mean by "moved forward or back" - how does that manifest itself in the formula result?

Barry
Avatar of singleton2787
singleton2787

ASKER

To determine whether the date being compared is ahead or behind the original date...it does calc correcly, but I can't tell at glance if the compared date is ahead or behind the orginal date.

A                               B                      C                         D                 E
12/01/2011              08/01/2011        03/01/2011          8                 5(this is before col B by 5 months)
You can do a simple comparison of the two dates:

   =IF(C1<B1,"Before","After")

Kevin
You can use the above formula in a conditional formatting rule to set the color of the cell.

Kevin
See attached example.
Q-26891394.xlsx
If you want you could make the results positive or negative, e.g. by using

=YEARFRAC(I683,K683,1)*12*SIGN(K683-I683)

regards, barry
Barry, works great...except the negative and positive are reversed. No big deal, but is the fix easy?
ASKER CERTIFIED SOLUTION
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial