How to find the difference between today and another date in Excel? -


i trying make function tells me difference between today , date. if date less month now, displays text1, if more month now, displays text2. also, if displays text1, should make cell color.

you make own udf (user defined function) achieves first part of above. unfortunately udf's cannot alter cell other return value. place following code module in workbook work.

          public function datecompare(evaldate date) string             dim cval integer              cval = evaldate - date              select case cval                 case <= 30                     datecompare = "text 1"                 case > 30                     datecompare = "text 2"             end select           end function 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -