Counting test case results using formula

subhah

New Member
Joined
Nov 6, 2007
Messages
7
I have my test cases in below format and I would like to calculate # of test cases passed or failed using formula. Can anyone pls. help?

-------------------------------------------------
Test case # Step # Result
-------------------------------------------------
Test case 1 Step 1 pass
Test case 1 Step 2 pass
Test case 1 Step 3 fail
Test case 2 Step 1 pass
Test case 2 Step 2 pass
Test case 2 Step 3 pass
Test case 2 Step 4 pass
Test case 3 Step 1 fail
Test case 3 Step 2 fail

I need below result using formula:
# of test cases - Pass = 1
# of test cases - Fail = 2

-Subha
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Thanks for the reply Kris!

=COUNTIF(TestCasesRange,"Pass") - This formula will include test steps too. but, i want to count only test cases..
 
Upvote 0
Hi,

Try:

D12: =SUM(IF(FREQUENCY(IF(C2:C10=C12,IF(A2:A10<>"",MATCH(A2:A10,A2:A10&"",0))),ROW(A2:A10)-MIN(ROW(A2:A10))+1),1))
Confirmed with Ctrl + shift + enter

D13: =SUMPRODUCT((A2:A10<>"")/COUNTIF(A2:A10,A2:A10&""))-D12
Book1
ABCD
1
2Test case 1Step 1pass
3Test case 1Step 2pass
4Test case 1Step 3fail
5Test case 2Step 1pass
6Test case 2Step 2pass
7Test case 2Step 3pass
8Test case 2Step 4pass
9Test case 3Step 1fail
10Test case 3Step 2fail
11
12fail2
13pass1
Sheet4
 
Upvote 0
I have another problem..

Actually, the test case # column has only numbers and not texts. so, the above formula does not work. It throws #N/A.

Can you pls. help?
 
Upvote 0
I have another problem..

Actually, the test case # column has only numbers and not texts. so, the above formula does not work. It throws #N/A.

Can you pls. help?

Control+shift+enter...

=SUM(IF(FREQUENCY(IF($A$2:$A$10<>"",IF($C$2:$C$10=C12,MATCH("~"&$A$2:$A$10,$A$2:$A$10&"",0))),ROW($A$2:$A$10)-ROW($A$2)+1),1))

and copy down.
 
Upvote 0
My test data is like below and the above formula gives me wrong results for "Pass". Need help again...

-------------------------------------------------------
Test case # Step # Result
-------------------------------------------------------
1 Step 1 pass
1 Step 2 pass
1 Step 3 pass
2 Step 1
2 Step 2
2 Step 3
2 Step 4
3 Step 1 pass
3 Step 2 fail
3 Step 3 pass
4 Step 1 fail
4 Step 2 fail


Actual result by formula:
fail 2
pass 2

Expected result:
fail 2
pass 1
 
Upvote 0
My test data is like below and the above formula gives me wrong results for "Pass". Need help again...

-------------------------------------------------------
Test case # Step # Result
-------------------------------------------------------
1 Step 1 pass
1 Step 2 pass
1 Step 3 pass
2 Step 1
2 Step 2
2 Step 3
2 Step 4
3 Step 1 pass
3 Step 2 fail
3 Step 3 pass
4 Step 1 fail
4 Step 2 fail


Actual result by formula:
fail 2
pass 2

Expected result:
fail 2
pass 1

Which records are valid and why in order to arrive at 1 for "pass"?
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,263
Members
449,149
Latest member
mwdbActuary

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