• 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.

Using dates as a condition within a formula

kstathis

New Member
Hi Chandoo,

Thanks so much for your blog, it's helped me a lot. I've been trying a Google search to solve my dilemma with no luck.


Currently my formulas look like this =IF(OR($T2<40787,$T2>41090),0,$W2)

meaning if the date in T2 is less than 9/1/2011 or greater than 6/30/2012, enter 0, otherwise enter the value of cell W2.


Is there any way to format the number (40787) as a date (9/1/11) within the formula so I know what the dates are just by looking at the formula?


Thank you so much.
 
You could use the DateValue function. It'd look something like:


=IF(OR($T2<Datevalue("01Sep11"),$T2>Datevalue("30Jun12")),0,$W2)
 
Back
Top