COUNTIF and COUNTA formula as a percentage

Springer_30

New Member
Joined
Oct 14, 2009
Messages
28
Good day

Have not posted here in ages but have a small problem

In the sheet below there are for example five students who have arrived either "Late" or "On Time" for classes over a period of three days

How do I calculate the percentage for each student of being "On Time" for the three days using COUNTIF and /or COUNTA?

[TABLE="class: grid, width: 400"]
<tbody>[TR]
[TD]Day 1
[/TD]
[TD]On Time / Late[/TD]
[TD][/TD]
[TD]Name[/TD]
[TD]% On Time[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]Late[/TD]
[TD][/TD]
[TD]David[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD]John[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Simon[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD]Simon[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD]Mary[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kate[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD]Kate[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Day 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]Late[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Simon[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]Late[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kate[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Day 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]Late[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]Late[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Simon[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]On Time[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kate[/TD]
[TD]Late[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Firstly that isnt a great way to set out your data. You would be much better off having the headers Name, Day and On Time/Late rather than just the two headers and blocks of days. That said you can use COUNTIFS. eg:

=COUNTIFS(A:A,D2,B:B,"On Time")/COUNTIFS(A:A,D2)

Format to percentage.
 
Upvote 0
Thanks Steve, it has worked

BTW, I do fully agree that the way the data was set out isn't great at all, it was however just put together for the purpose of attaining the formula
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

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