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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COUNTIF and TODAY()

Status
Not open for further replies.

moltar

Programmer
Mar 8, 2002
26
US
I am trying to count the number of cells that have date values equal to or less than today's date.

The formula is in A1, and the contents of A2:D2 is as follows:

A2 = 01/01/2004
B2 = 02/01/2004
C2 = 03/01/2004
D2 = 04/01/2004

=COUNTIF(A2:D2,"01/1/2004")

This formula results in a value of 1. How do I change it to swap the criteria's static date to either NOW() or TODAY()? When I do that, such as with

=COUNTIF(A2:D2,"<=TODAY()")

then it just results in 0.

Help!
 
Hi moltar,

You need to have TODAY() outside the quotes to have it interpreted as a Function instead of a literal. Try entering ..

[blue][tt]=COUNTIF(A2:D2,"<="&TODAY())[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top