Calculator Basics
Overview:
The use of calculators in AgStudio can be a very detailed, very helpful tool. Using calculators can have you utilize many attributes within a layer or layers for many uses of seeding and fertility.
We will go through the basics of setting up and writing and formatting a calculator in Excel for use in AgStudio
Requirements:
- Microsoft Excel
- Layers with Attributes in AgStudio
Process:
Most of this article will refer to the steps IN Excel, we will only refer to AgStudio when it gets to our variables and recommendations.
In Excel you will want to start with a blank worksheet, OR, you can download the calculator template in this related article.
The first step is you will want to create 3 distinct areas, we will go through each of these in detail:
- Conditionals - refers to the conditions where this calculator will run (i.e. Crop = Corn).
- Variables - These are the attributes used to calculate your outcomes/recommendations, either from a layer, fieldop data, or a manual input.
- Results - This is where we set the formula for our recommendations or outcomes of our variables.
Each of these sections will need their areas in the worksheet named in Name Manager, found in Formulas > Name Manager.
Conditionals:
This region usually contains two cells per conditional. One cell will contain the name of the condition, and the other cell, normally right next it, what the condition needs to be for the calculator to run. Normally we see this with say Crop or Commodity. This is optional and don't need a conditional, for the calculator to run in any "condition."
Variables:
This region contains the list of variables/attributes that the user wants to use for the specified outcome, values, and how they are presented in AgStudio. The variables need to be labelled EXACTLY like the attributes in your layers in AgStudio (i.e. Buffer pH is labelled as BpH in AgStudio, so the name of the variable in the calculator needs to be BpH and not Buffer pH).
Each line with a variable contains four pieces of information.
- Attribute name - name of attribute in a Layer in AgStudio or Name of a manual input you want to use.
- Value - this cell will contain the "value" of the cell that is usually gathered from the layer or manually input
- Unit of Measure - This contains how we will read the rate from the attribute or the input. If it is a group or text value, this is usually "None."
- Value Type - contains what kind of value we are looking for in the calculator. This is usually Numeric, Text, or Boolean (true/false).
In Name Manager (Formulas), you will need to identify each "value" cell for each attribute as well as the entire Variables region.
Results:
This region contains the results for your recommendations that will show up. Each line in results will display a different result/recommendation you want to calculate. Each line will contain 5 pieces of information.
- Result Name - The name of the result you are trying to produce, this is normally the nutrient abbreviation following with a "_rec" (i.e. P_rec).
- Result - this cell will be the result value. This will be where you would actually include the formula for your recommendation.
- Unit of Measure - the unit of measure for your recommendation (i.e. lb/acre, seed/acre).
- Value Type - what kind of value the result will be, either Numeric or Text.
- Scope - this piece of information will tell AgStudio what this result will be used for, typically NutrientRate or SeedRate.
In Name Manager you will just specify the area of the Results, each line plus the 5 cells.
Name Manager:
Using this Tool helps AgStudio determine names and areas where information is located within the worksheet. Each "name" will contain the name, the cell/cells it's related to, and which tab within the worksheet your are specifying.
To access Name Manager go to Formulas and then click on Name Manager, and the tool will appear where we can Add, Edit, or Delete.
Below is a simple Calculator and how to label areas/cells in Name Manager.
Conditionals, Variables, Results - required names AgStudio needs to search for information. Referring to the colored areas.
Attributes - each variable listed individually, note that the value cell is the only cell referenced (i.e. pH = cell C5)
Scope - the worksheet in Excel you are referencing.
Formulas:
Some knowledge of how to write a formulas in Excel is helpful. How to reference cells, formatting, different tools (IF/THEN, VLOOKUP, etc.).
Completion:
Once Calculator is saved. It will need to be imported into AgStudio for use of recommendations.
Related Articles
How do I import/add calculators?
How do I build a nutrient recommendation script?