• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

If using dates not working

theath

New Member
I have the following columns and Rows


H3: Date (on spreadsheet is 11/14/2011)

E5: Contract End Date (on spreadsheet is 09/30/2012)

G5: Dollar Amount


I want to evaluate a cell to see if the date in H3 is less than or equal to the date in E5. I am only concerned with the month and year.


I am using the following formula but it is not working correctly. The cell displays 0, but I would expect it to show the value in G5.


=IF(AND(MONTH(H3)<=MONTH(E5),YEAR(H3)<=YEAR(E5)),G5,0)


This is not working. My
 
In order to calculate the date in H3, I am using the following formula: =EDATE($A$3,1)


This changes the year to 1900 :(
 
Formula in H3 should probably be:

=TODAY()

Your IF formula could be this:

=IF(TEXT(H3,"yyyymm")<=TEXT(E5,"yyyymm"),G5,0)
 
i meant changing your original formula to


IF(AND(MONTH(H3)<=MONTH(E5),YEAR(H3)<=YEAR(E5)),G5,0) to


IF(AND(VALUE(MONTH(H3))<=VALUE(MONTH(E5)),VALUE(YEAR(H3))<=VALUE(YEAR(E5))),G5,0)


there was no mention of A3 or H3 is today's day so I had to assume H3 could be any date input manually.


Next time, please clearly state your question and any other info we may need to know. Else it would be difficult to understand what you are truly looking for.


Thanks.
 
Back
Top