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

COUNTIF, USING CRITERIA

Status
Not open for further replies.

oggsta

Technical User
Jun 22, 2002
41
GB
I would like to count all the columns in B3;B307 that contain the text SE, and then count all the columns in F3 and F307 that are between two dates.
C12 in this case equals 1-1-03
C13 and 11-7-03

This formula works for below howver this includes all dates greater than the 1-1-03;
=SUM(IF(Ntl!B3:B307="se",IF(Ntl!F3:F307>=C12,1,0)))

Howver when i cahnge it as follows so is between tow dates ie 1-1-03, 11-7-03, it comes up with a 0 value, it appears there is a basic problem with the syntax.

=SUM(IF(Ntl!B3:B307=&quot;se&quot;,IF(Ntl!F3:F307>=C12<11-7-03,1,0)))

Any help as to why this is happening would be appreciated.
 
oggsta,
Do you want to COUNT or SUM?

How does column B relate to column E? Do you want to count or sum ONLY when the dates are within your start and end values AND the corresponding value in column B is &quot;SE&quot;?

You are not very clear about what you want.


Skip,
Skip@TheOfficeExperts.com
 
Sorry

I would like to count the dates in columns F3:F307 that are between the dates within my start and end values which also equal &quot;SE&quot; in the corrosponinding row of column B (B3:B307.
 
Assuming the text in the cells in Column B that you wish to count, contain ONLY SE and the SE is not just part of the text.

=SUMPRODUCT((B3:B33=&quot;SE&quot;)*(F3:F33>=C13)*(F3:F33<=C12))

Regards
Ken..............
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top