COUNT Formula

dgavin

Active Member
Joined
Feb 16, 2005
Messages
302
I trying to get my formula to count 2 different results...

In sheet2

In sheet 2 column A are names and in B are results e.g

Chris "PASS"
Chris "FAIL"

If chris has a PASS and a Fail result, then my formula will give "STOP" if not then blank

I have tried write it but need help?

=IF(T5>0,"CLEAR",IF(AND(COUNT(Sheet2!$A$2:$A$5000,"Chris")+COUNT(Sheet2!$B$2:$B$5000,PASS+FAIL)=1,H5>0,STOP,"")
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
in column c use the formula =A1&" "&B1 to combine the cells together from a and b, so you get a single result "chris pass" or "chris fail"

then in another cell use the formula
=IF(AND(COUNTIF(C:C,"chris pass")>=1,COUNTIF(C:C,"chris fail")>=1),"stop","")
 
Upvote 0
Thanks Bryon,

to amend the formula slightly,

if the names are changing all the but i still wanted to count if one person had both a pass and a fail. would i need add 2 vlookups?

the names are alway on sheet1 so if

if chris is in sheet1 column A and is found in sheet2 column A, and has Pass and Fail in sheet2 column B

how would i write this formula?
 
Upvote 0
if the names are in column A so chris is in a1, then do as before. on sheet 2, combine the name and pass/fail in column c with the a1&" "&b1 and drag it down.
then in sheet1 column b next to your names use the formula
=IF(AND(COUNTIF(Sheet2!C:C,A1&" pass")>=1,COUNTIF(Sheet2!C:C,A1&" fail")>=1),"stop","")
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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