# Counting occurrences across a record in ArcGIS 10.0

I'm a student at Millersville University, PA studying for a BA in Geography with a concentration in GIS. I've stumbled across this site for questions I've had over the past year or so with getting introduced to ArcGIS. So thank you all here for helping a student out :)

I have come across a problem that I can't figure out and my textbook didn't offer any help so I'm hoping one of you can.

I have a table which consists of 3 attribute joins, and I have a text field which has 2 unique values. I want to create a field in which I can summarize the number of times a particular text occours.

For Example: Jx = Join #

``````ObjectID 1 |J1: A | J2: A | J3: B | CountFldA: 2
ObjectID 2 |J1: B | J2: B | J3: A | CountFldA: 1
``````

I have a feeling that the answer lies somewhere in python but I have no formal experience in it.

Thanks for any insight in advance! wxmeddler from Millersville.

-
welcome to the site! Have you taken a look at the frequency tool? – Stephen Lead Sep 27 '12 at 4:59
@ Stephen Lead Close, the frequency is defined on the link you gave as `_"Reads a table and a set of fields and creates a new table containing unique field values and the number of occurrences of each unique field value."_` What I'm looking for is the frequency across the record. Instead of counting down, I'm counting across. Complicated by the fact that it's a text field. – wxmeddler Sep 27 '12 at 7:44
ah, that makes sense - sorry I missed that crucial detail. The way to approach this will be to iterate through each record using an ArcPy SearchCursor, and analyse the values in-memory. I'll write some pseudo-code in the morning if you haven't solved it by then :) – Stephen Lead Sep 27 '12 at 10:11
Rayner's answer is great - I should have said "one way to approach this" since his is faster. – Stephen Lead Sep 27 '12 at 22:49

Perfect @Rayner! This did exactly what I wanted... The VBscript ended up looking like: `InStr( [cd111.PARTY] , "Democrat") + InStr( [cd110.PARTY], "Democrat" ) +InStr( [cd109.PARTY] , "Democrat" )` – wxmeddler Sep 27 '12 at 13:22