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

simple code for MS Excel 3

Status
Not open for further replies.

sidalam

Programmer
Nov 21, 2003
94
I want to write a simple code that calculates all the cells that have a value greater then 5 in the range T3:t119. What am I doing wrong?

=countif(T3:T119, <5)
 
Put the condition inside quotes.

Code:
=COUNTIF(T3:T119,">5")

( Note that I used Greater Than rather than Less Than which you gave in your example )

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Thank you GlenUK this has been great help.

I have a new question.

I want to write a simple code that calculates all the cells that have a value less then 5 in the range T3:t119 BUT NOT COUNT ANY VALUE THAT HAS A CELL VALUE 0.

HERE IS THE CODE SO FAR

=COUNTIF(T3:T119, "<=5")
 

hi,
[tt]
=COUNTIF(T3:T119, "<=5") - COUNTIF(T3:T119, "0")

[/tt]

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top