Print Page | Close Window

countif

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10635
Printed Date: 04 May 2025 at 6:36pm


Topic: countif
Posted By: lhanli
Subject: countif
Date Posted: 25 Jul 2010 at 10:05pm
Hello all,
I have excel sheet.The column containes "Y" and "N" value.I want to count N or Y.   Howmany are there Y or N
The range exp. (between  B1 to B400 Y or " N ). How can do it. what sould I write formula.
Pls help me.I am beginner user for CR.
Thx everybody



Replies:
Posted By: kcat
Date Posted: 25 Jul 2010 at 11:32pm
Hi Ihanli,
 
Can I just clarify.... are you reporting through Crystal on your excel sheet and want to count records in a field of a certain type? If so what is the field name of your B column and have you got an index column?
 
Regards
kcat


Posted By: lhanli
Date Posted: 26 Jul 2010 at 1:39am
firstly thx kcat,
Yes I want to count "Y" or  "N" records in the column.Howmany "Y" are there in the Answer column
For example
I have like this excel sheet
 
Answer     Right  
Y                   Y           Y means YES
Y                   N           N means NO.
Y                   Y
N                  Y
N                  Y
 
There are 3Y (for Answer column)
There are 2N (for answer column)  
 
There are 4Y (for RIGHT column)
There are 1N (for RIGHT column) 
 
regards
lhanli
 


Posted By: kevlray
Date Posted: 26 Jul 2010 at 5:10am
running totals for each of the fields, evaluate only when the condition is true (i.e., {Answer} = "Y").
I hope this helps.


Posted By: hilfy
Date Posted: 26 Jul 2010 at 11:09am
An alternate way of doing it is to create two formulas:
 
mailto:%7b@IsYes - {@IsYes }
if {table.correct} = 'Y' then 1 else 0
 
mailto:%7b@IsNo - {@IsNo }
if {table.correct} = 'N' then 1 else 0
 
You can then use these in summary formulas to do your counts.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: lhanli
Date Posted: 26 Jul 2010 at 8:24pm
thank you very much your help



Print Page | Close Window