Solved

YEARFRAC question

Posted on 2011-03-16
8
528 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:singleton2787
  • 3
  • 3
  • 2
8 Comments
 
LVL 50

Expert Comment

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

Barry
0
 

Author Comment

by:singleton2787
ID: 35150300
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)
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35150634
You can do a simple comparison of the two dates:

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

Kevin
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35150646
You can use the above formula in a conditional formatting rule to set the color of the cell.

Kevin
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35150714
See attached example.
Q-26891394.xlsx
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35150905
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
0
 

Author Comment

by:singleton2787
ID: 35151352
Barry, works great...except the negative and positive are reversed. No big deal, but is the fix easy?
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 35151889
Yes just reverse the cells in the SIGN function like this

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

regards, barry
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

746 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now