Calculation of % of "yes" in a column

russellday

New Member
Joined
Apr 30, 2015
Messages
24
Hi I have a set of columns G7:I25 of results that contain yes,no or N/A. I would like to count the "yes" and "N/A results and then work out as a % of all results.

I have the formula below which counts yes and then works a % of yes+no but want to include also the N/A



=IFERROR(COUNTIF(G7:I25,"Yes")/(COUNTIF(G7:I25,"Yes")+COUNTIF(G7:I25,"No")),"")

Thanks in advance
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
russell,

See if this formula gives you the desired result. This formula adds the number of Yes and #N/A and then divides by Yes plus No plus #N/A

=IFERROR((COUNTIFS(G7:I25,"Yes")+COUNT(ISNA(G7:I25)))/((COUNTIF(G7:I25,"Yes")+COUNTIF(G7:I25,"No")+COUNT(ISNA(G7:I25)))),"")
 
Upvote 0
Hi, here is another option, please note that this assumes the N/A's are the literal text, not #N/A formula errors.

=IFERROR(SUM(COUNTIF(G7:I25,{"Yes","N/A"}))/SUM(COUNTIF(G7:I25,{"Yes","No","N/A"})),"")

If the range can only contain "Yes", "No" or "N/A" then this can be simplified to.

=IFERROR(SUM(COUNTIF(G7:I25,{"Yes","N/A"}))/COUNTA(G7:I25),"")
 
Upvote 0
russell,

See if this formula gives you the desired result. This formula adds the number of Yes and #N/A and then divides by Yes plus No plus #N/A

=IFERROR((COUNTIFS(G7:I25,"Yes")+COUNT(ISNA(G7:I25)))/((COUNTIF(G7:I25,"Yes")+COUNTIF(G7:I25,"No")+COUNT(ISNA(G7:I25)))),"")


Excellent Thanks :)
 
Upvote 0
Hi, here is another option, please note that this assumes the N/A's are the literal text, not #N/A formula errors.

=IFERROR(SUM(COUNTIF(G7:I25,{"Yes","N/A"}))/SUM(COUNTIF(G7:I25,{"Yes","No","N/A"})),"")

If the range can only contain "Yes", "No" or "N/A" then this can be simplified to.

=IFERROR(SUM(COUNTIF(G7:I25,{"Yes","N/A"}))/COUNTA(G7:I25),"")

Excellent Thanks
:)
 
Upvote 0

Forum statistics

Threads
1,216,125
Messages
6,128,998
Members
449,480
Latest member
yesitisasport

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