Running date formula in excelsheet

Posted on 2014-03-30
Last Modified: 2014-04-01
Hello, I have a column that includes an employee start date (i.e. 1/4/2002). I was hoping to put in an allowance column, for each employee, to have a formula which automatically inserts their $200 allowance when they have work a full year.

Look forward to your solution
Question by:Ozwazza
  • 3
  • 2
LVL 81

Expert Comment

ID: 39965774
Consider a formula like the following:

It will return an empty string (looks like a blank) if the employee has worked less than one year. It will return 200 on their anniversary date and thereafter.
LVL 81

Expert Comment

ID: 39965779
DATEDIF is a "secret" function that has been part of Excel for a long time, but was only documented in Excel 2000. Even though it is undocumented, you can still use it for problems like this.

If you want to learn more about the DATEDIF function, Microsoft Excel MVP Chip Pearson has a good webpage on it:

Author Comment

ID: 39968155
Hello excel gurus, the datedif function will not work because it is always >=1 if the year is >2013.  I can only write in pseudocode (showing my age!)

IF (start date year) <= (Year(today)-1) THEN
 IF (start date month) >= (month(today)) THEN
    IF (start date day) >= (day(today)) THEN
    END IF
    IF (start date month) >= (month(today) THEN
       IF (start date day)>=(day(today)) THEN
      END IF

can someone give me a an excel formula for that?

LVL 81

Accepted Solution

byundt earned 500 total points
ID: 39968476
Your pseudocode results in the following formula:

That formula returns $200 if you are before your anniversary, and 0 afterwards. You asked for the opposite in your original question.

I still believe that DATEDIF is the right way to go, but the proof will be in testing with some sample data. Please see the attached workbook showing the two formulas in action.

If neither formula is working, please suggest some alternative test dates and give the desired results for those dates. That will surely be easier than debugging pseudocode.


Author Closing Comment

ID: 39970897
Wonderful, cheers

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
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…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

14 Experts available now in Live!

Get 1:1 Help Now