Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing dates in excel

Status
Not open for further replies.

Pandab2002

IS-IT--Management
Apr 16, 2003
47
US
I want to be able to quickly browse a spreadsheet to see how many items are "past due". I am trying to build a process that looks at dates in a column and compares it to todays date. If it is before today's date I want to count it, if it after today's date i want to ignore it.

z = Format(Now, "m/d/yyyy")
If date < z Then a = a + 1 (or something like that)

any suggestions???

Thank you
 
Hi Pandab2002,

The result of a Format is a STRING.

If you have DATES in your cells then simply compare them to (unformatted) Now.

If you have TEXT in your cells then you need to make sure you have properly comparable formats.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Pandab2002

Why not just do it with conditional formating.
Select the range you want and set the condition to be where cell value is greater then or equal to =now()

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top