# Counting points in polygons using ArcGIS Desktop?

I have a table as follows:

I have points and polygons. Every polygon has a variety of points inside. Some have 6, some have 12, some have 0. FID_2* is polygon ID. I would like to populate Count( 9th column above) automatically according to FID_2*, that is, polygon ID. For example, when FID_2* says 46( first row) I want Count to be populated as 6 because I would like to match each point with the polygon they are in. (Polygon 46 has 6 points)

This is another picture showing my points and polygons:

Could you help me solve this?

"Procedure

Create a count field and a spatial join between the point shapefile and the polygon shapefile.

1. In the attribute table of the point shapefile, create a field called 'Count' of type 'Short Integer'.
2. Calculate the Count field equal to 1 by right-clicking the field name > Field Calculator > Enter a 1 in the white dialog area below "Count = ", and click OK. [O-Image] Field Calculator Count = 1
3. Right-click the polygon shapefile and click Joins and Relates > Joins. Click the dropdown list and select 'Join data from another layer based on spatial location'.
4. Specify the point shapefile from Step 1.
5. Select the first bullet (Each polygon is given a summary of the numeric attributes...) and check the 'Sum' box.
6. Specify an output location, and click OK.
7. A polygon shapefile with the 'Count' field indicating how many point features lie within each polygon feature is now present. This is usually named 'Sum_Count' or 'Count_'.

"

I agree with @BERA's solution if you are trying to count the number of points in a polygon, and it is safer in many cases than relying on pre-populated point feature attributes. But if you simply have a table of polygon IDs and you are wanting to ignore the polygon geometry and just get the count of the number of times a specific polygon ID shows up in the point feature class's attribute table, then a table summary may work for you.

In ArcMap, if you open the attribute table of the point FC, right click on the FID_2 field and select "Summarize...". The output of that operation should be a table of the FID_2 values and the desired count field.

Then you can bring that newly created table into ArcMap and do a table to table join (http://desktop.arcgis.com/en/arcmap/latest/manage-data/tables/essentials-of-joining-tables.htm), joining the summary table to the point FC based on the FID_2 field.

Finally you can run Calculate Field on the Point FC's Count field, populating it with the value of the summary table's count cnt_fid_2 field (that field name may vary slightly).

• Thank you John, I solved my problem with spatial join. That is where I was doing wrong. Thank you for your concern. Mar 21, 2018 at 15:08

In ArcGIS Pro, you can directly use the tool `Summarize Within` or `Spatial Join` in Geoprocessing.