0
votes

I am new to MS excel and trying to write a MS excel formula : Here I want to COUNT the number of TRUE and FALSE values

example of the senario:

Functional Area Test type
Multiple         FALSE
OS               TRUE
Multiple         TRUE
TPS              FALSE
OS               FALSE
Multiple         TRUE
Multiple        FALSE
TPS              TRUE
Multiple         TRUE
Multiple        FALSE
OS              TRUE
Multiple        TRUE
OS              FALSE
TPS             TRUE
OS             FALSE


Functional Area   TRUE    FALSE
Multiple         _____    ____    
OIS              _____    ____  
TPS              _____    ____   

what is the format of formula for the TRUE and FALSE cell

code would be something like;

int count=0;
for(i=0;i< totalrows(functional area);i++)
{
 if(functiona area=="ÖIS"&&Test type=TRUE)

cell value=count++; 

} 
2
Use a Pivot Table.Scott Craner
Thanks i shall try it outStep

2 Answers

0
votes

You don't need to create a function you could just use the excel countif() function. For example if i had true and false values in column c i would put this formula below the column =COUNTIF(C1:C15,"True") followed by this in another cell =COUNTIF(C1:C15,"false")

Hope that helps.

0
votes

Another option is to highlight your entire Data set, click "Formula" tab, select "Create from selection" and then click "Top Row" box.This will name your ranges of Data. This will also allow you to input the following Array formulas neatly into your example table:

Multiple=True: =SUM((FunctionaLArea="multiple") * (Test_type=TRUE))

Multiple=False: =SUM((FunctionaLArea="multiple") * (Test_type=FALSE))

OS=True: =SUM((FunctionaLArea="OS")*(Test_type=TRUE))

OS=False: =SUM((FunctionaLArea="OS")*(Test_type=FALSE))

TPS-True: =SUM((FunctionaLArea="TPS")*(Test_type=TRUE))

TPS=False: =SUM((FunctionaLArea="TPS")*(Test_type=FALSE))

Each formula can be entered on the appropriate line using Ctrl +Shif +Enter.