# Calculate the min of other fields

How can I calculate the min of other fields. For example I have 3 field: a, b and c. I want to have a filed that show me the minimum value of the 3 field. Finally I want to know the minimum value is of a or b or c. Thank you.

-
Many questions on this site have discussed field calculations. Search our field-calculator tag for examples, such as the one at gis.stackexchange.com/questions/34356/…. – whuber Oct 5 '12 at 16:16

Using Python in the Field Calculator, here's how you would determine the minimum value across 3 fields.

``````min([!field1!, !field2!, !field3!])
``````

Then to identify which of the 3 fields contains the minimum value, you can just do a series of Select By Attributes queries

"field1" = "minfield" (or whatever you call your new minimum value field)

then calculate a new text field equal to whichever field name you use in your query.

-
thanks a lot but I don't know how can I use "python".I should install it? – bahar Oct 5 '12 at 16:19
Python is installed with ArcMap. Use the Calculate Field tool in the data management toolbox. Select the field that you want to calculate, then for the expression enter min([!a!, !b!, !c!]) where a b and c are your field names. For expression type choose Python, then run the tool – egdetti Oct 5 '12 at 16:31
thanks again.I did the firs stage.now what should I do about the query? it shod be start of where? – bahar Oct 5 '12 at 17:22
I think I should use "make query table" but how? – bahar Oct 5 '12 at 17:33
It will help if you learn the basics of the software. youtube.com/watch?v=aRKOqu-cdnE – Rayner Oct 5 '12 at 18:04

Here are code snippets for ArcGIS 10.0

analysis toolbox
statistics toolbox
arcpy.Statistics_analysis("futrds", "C:/output/output.gdb/stats", [["a", "MIN"],["b", "MIN"],["c", "MIN"]])

rows = arcpy.SearchCursor(C:/output/output.gdb/stats")
for row in rows:
min_values = [row.min_a, row.min_b, row.min_c].sort()
min_val = min_values[0]

-