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
Post a Comment