Non-consecutive countif divided by non-consecutive counta

mtaylor

Board Regular
Joined
May 1, 2013
Messages
73
Platform
  1. Windows
  2. MacOS
Hi there,

Ok so...

The 14th, 15th and 17th I would like counting the number of "P"'s there are, divided by the number of cells containing "something". I have this set up nicely for previous weeks, however I've become stuck now that the days I want are non-consecutive.

Previous weeks I use the formula: =IF(COUNTA(BN3:BR3),(COUNTIF(BN3:BR3,"P")+COUNTIF(BN3:BR3,"L"))/COUNTA(BN3:BR3)*100,"")

Now I'm looking at something along the lines of: =IF(COUNTA(BT3:BU3,BW3),(COUNTIF(BT3:BU3,BW3,"P")+COUNTIF(BT3:BU3,BW3,"L"))/COUNTA(BT3:BU3,BW3)*100,"")

It would appear they don't like the comma before the "P" and "L"

The cell under Week 13 % is where the formula should be going.


HSHS
14/0615/0616/0617/0618/06Week 13 %
PPUAPUA#N/A


Thanks in advance folks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
What is the reason behind the choice of dates? From your example, I see

=IFERROR(SUM(COUNTIFS(BN3:BR3,{"P","L"},BN1:BR1,"<>HS"))/COUNTA(BN3:BR3),"")
 
Upvote 0
What is the reason behind the choice of dates? From your example, I see

=IFERROR(SUM(COUNTIFS(BN3:BR3,{"P","L"},BN1:BR1,"<>HS"))/COUNTA(BN3:BR3),"")

Just because some days students are required for exams, whereas other days are just self study at home.
 
Upvote 0
whereas other days are just self study at home.
I assume that this is identified by "HS" in the top row?

Try this formula
=IFERROR(SUM(COUNTIFS(BN3:BR3,{"P","L"},BN1:BR1,"<>HS"))/COUNTIFS(BN3:BR3,"<>",BN1:BR1,"<>HS"),"")
 
Upvote 0
Solution
I assume that this is identified by "HS" in the top row?

Try this formula
=IFERROR(SUM(COUNTIFS(BN3:BR3,{"P","L"},BN1:BR1,"<>HS"))/COUNTIFS(BN3:BR3,"<>",BN1:BR1,"<>HS"),"")

Correct - the HS stands for Home Study. I'll have a look.

Thank you
 
Upvote 0
I assume that this is identified by "HS" in the top row?

Try this formula
=IFERROR(SUM(COUNTIFS(BN3:BR3,{"P","L"},BN1:BR1,"<>HS"))/COUNTIFS(BN3:BR3,"<>",BN1:BR1,"<>HS"),"")

You're a hero.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

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