Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a 'countif'

Status
Not open for further replies.

devilsedge

IS-IT--Management
Mar 14, 2007
3
CA
All,

Please assist. I am looking to build a formula to initially look for a certain text within a field than count the number of interrations.

thus far I have ...

numbervar New;
If {PH.ENTRY_TYPE} = "Holiday" Then
New:=New + 1

... but the variable does not reset.
 
Why not just create a separate counter formula -

IF {PH.ENTRY_TYPE} = "Holiday" THEN 1 ELSE 0

The use SUMMARY counter to count it in your footer.
 
MJRBIM,

Good point. However, I need to clarify further. The source data in this case may have multiple instances of "Holiday". Ideally the preview would need to appear as

Date name holiday count
Year 2002 devilsedge 6
year 2003 devilsedge 2
year 2004 devilsedge 3

currently, in my preview i have
Date name holiday count
Year 2002 devilsedge 6
year 2003 devilsedge 8 (accumulative value of 6 + 2)
year 2003 devilsedge 0 (duplication line item)
year 2004 devilsedge 11 (accumulate value of 6 + 2 + 3)
year 2004 devilsedge 0 (duplication line item)
year 2004 devilsedge 0 (duplication line item)
 
Please explain whether holiday count in your current preview is a database field or a formula, and if a formula, please show the formula.

Also, why wouldn't you just group on the name field instead of creating a conditional formula related to the name field?

-LB
 
On second thought, I think you need to show detail level data, along with the current formula you are using to summarize. My guess is your current preview is already at a summary level.

-LB
 
ideally the 'holiday count' would be a formula.
 
You are not providing sufficient information. Please show a sample of detail level data and then show a second sample of how you want your results to look.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top