Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: countif Post Reply Post New Topic
Author Message
lhanli
Newbie
Newbie


Joined: 25 Jul 2010
Location: Turkey
Online Status: Offline
Posts: 3
Quote lhanli Replybullet Topic: countif
    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


Edited by lhanli - 25 Jul 2010 at 10:06pm
IP IP Logged
kcat
Newbie
Newbie
Avatar

Joined: 25 Jul 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote kcat Replybullet 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
IP IP Logged
lhanli
Newbie
Newbie


Joined: 25 Jul 2010
Location: Turkey
Online Status: Offline
Posts: 3
Quote lhanli Replybullet 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
 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 26 Jul 2010 at 11:09am
An alternate way of doing it is to create two formulas:
 
if {table.correct} = 'Y' then 1 else 0
 
if {table.correct} = 'N' then 1 else 0
 
You can then use these in summary formulas to do your counts.
 
-Dell
IP IP Logged
lhanli
Newbie
Newbie


Joined: 25 Jul 2010
Location: Turkey
Online Status: Offline
Posts: 3
Quote lhanli Replybullet Posted: 26 Jul 2010 at 8:24pm
thank you very much your help
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.