COOUNT IF statement with AND?

gg

Well-known Member
Joined
Nov 18, 2003
Messages
560
Can I have a Count if "AND" statement? Together?

Countif(AND(.......?

Two criteria must be met before the count?
 
gg said:
I am just trying to understand how I can apply it to the others.

3 in 4 days
4 in 5 days

???Any ideas?
{Snip}
See my function. Notice the >= criteria?
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
You simply want to click on c1 in the 'spreadsheet.' No matter, here she is:

=SUMPRODUCT((A1:A13>=TODAY()-1)*(B1:B13="Fred"))

That's the last two days, today()-2 is 3, etc.... You can also add a third criteria to put a roof on your recordset.
 
Upvote 0
Nate thanks for your help.
I can get it to work for the Back to Back days.
What about if Fred occurs in 3 out of the last 4 days?

any idea?
 
Upvote 0
You are welcome. :)

The logic is opaque eh? Try:

>=today()-3

Just use a boolean expresion, e.g., =3=sumproduct(blah blah)
 
Upvote 0
Hi gg:

As Just_Jon has stated it would be nice to see you post some sample data. However, let me asume that your layout looks like the following ...
Book3
ABCDEFGHIJKL
1DatesNamesNames2Scores
201/07/2004JaneKay2ScoreScoreScoreScore
301/06/2004JaneKay3NamesNames2Statustodayyesterday4In4Last5D3In4Last4D
401/05/2004JaneKay4JanekayoverworkedTRUETRUETRUETRUE
501/04/2004JaneKay5BobLutznot_overworkedTRUEFALSEFALSEFALSE
601/03/2004JaneKay3RichCongoverworkedTRUETRUETRUETRUE
701/02/2004JaneKay1BillCongnot_overworkedTRUEFALSEFALSEFALSE
801/07/2004BobLutz2
901/07/2004BillCong3
1001/02/2004RichCong5
1101/03/2004RichCong5
1201/04/2004RichCong5
1301/05/2004RichCong5
1401/06/2004RichCong1
1501/07/2004RichCong5
Sheet5b


The formulas in cells I4:L4 are ...

=SUMPRODUCT((B2:B15=$F4)*(C2:C15=$G4)*(A2:A15=TODAY()))=1

=SUMPRODUCT((B2:B15=$F4)*(C2:C15=$G4)*(A2:A15=TODAY()-1)*(D2:D15>0))=1

=SUMPRODUCT((B2:B15=$F4)*(C2:C15=$G4)*(A2:A15>=TODAY()-3))>=3

=SUMPRODUCT((B2:B15=$F4)*(C2:C15=$G4)*(A2:A15>=TODAY()-4))>=4

and the formula in cell H4 is ... =IF(COUNTIF(I4:L4,TRUE)=4,"overworked","not_overworked")

I hope this helps.
 
Upvote 0
I need to figure our how to post my excel layout...
Let me try to figure it out..

I think you guy's have the idea but we are a little different.
 
Upvote 0
Ok folks lets start over.....
Below is what I want to happen. Columns A,B & C are input on a daily basis.
However, I want to see the impact of several test over a short period. Through out the year there will be 100 total test and the schedule dynamics have an impact. I am just not sure what it is...

I am not sure what is the easiest method. I thought I could get a SUM(If statement to work but I can't...

Column D,E & F should be formulas looking back to see what criteria is being met.

Please let me know what you think.

Sorry this has taken so long...Learning the htm maker was another learning experience. :oops:
Book1.xls
ABCDEF
1DateNameScorebacktoback(BTB)3test4days(3N4)4test5days(4N5)
21/1/2004Pete75BTB
31/1/2004Cindy80BTBBTB
41/2/2004Cindy82
51/3/2004Bob89
61/3/2004Pete95
71/4/2004Al96
81/4/2004Bob91BTB
91/4/2004Cindy93
101/4/2004Pete88BTB3N4
111/5/2004Cindy72BTB3N4
121/6/2004Al76
131/6/2004Bob49
141/6/2004Pete89
151/7/2004Al96BTB3N4
161/7/2004Bob65BTB3N44N5
171/7/2004Cindy87
181/7/2004Pete92BTB3N44N5
Sheet1
 
Upvote 0
Hi gg:

I don't think I follow the results you have posted in columns D, E, and F in your last post. However, please look at ...

For sake of simplicity, and to help debug during development, I have use columns G, H, and I to hold intermediary calculations.

Please review the results and post back if these are OK -- otherwise explain a little further and then let us take it from there.
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,465
Members
448,965
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top