Update formula to count alpha rather than numeric

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
how do I update this formula to perform the same calculation with N and Y as it did with 0 and 1. N=0 and Y=1
=COUNTIF(T4:T1003,0)/(IF(T4=1,0,1)+COUNTIF(T4:T1003,1))

I tried the following but it gave me "#Value" as a result
=COUNTIF(T4:T1003,"N")/(IF(T4="Y","N","Y")+COUNTIF(T4:T1003,"Y"))
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
You are trying to divide with text and that is the problem with the "#VALUE"

the if needs to be changed to numbers - maybe this
Code:
=COUNTIF(T4:T1003,"N")/(IF(T4="Y",1,0)+COUNTIF(T4:T1003,"Y"))
 

Forum statistics

Threads
1,176,627
Messages
5,904,112
Members
435,074
Latest member
McKay_S

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
Top