Origin 2022 offers a new feature called “Names”. If you are an Excel user, you may be familiar with the concept. Well, now we have them in Origin. For those who are unfamiliar with Names, they are essentially like a variable that points to a range of cells in a worksheet making it easier to refer to the range. That variable can then be used in many places where formula are used including:
- Set Column Values formula.
- Cell formula.
- As input to X-Function-based operations such as those used in many Origin analyses.
Some features of named ranges (Names) include:
- Names can be used as functions.
- Formula and analyses will update when the data behind the Name changes.
- They can be scoped to the sheet, book, or project level. By “scope” I mean the level for which the Name is applicable.
How to Define and Manage a Name
Defining a Name is simple. There are three methods:
Select a single or contiguous range of cells and, from the Data menu, choose Define Name… . In the dialog, provide a name for the Name and define its scope. The Name must consist of a minimum of four ASCII alphanumeric characters (A-Z,a-z,0-9), start with a letter, and contain no spaces or punctuation marks. The scope can be one of Sheet, Book, or Project.
Select a single or contiguous range of cells and, from the Formula Bar, enter a Name in the leftmost edit box. When defining the Name in this way, the scope is automatically set to Book.
The third method for creating a Name is to use the Mini Toolbar when selecting a single cell. This method only works for single cell selection.
A Cool Trick
Here’s a cool trick: Let’s say you want to define a Name based on a cell and there is a text identifier in the cell just to the left of the selected cell. When defining the Name, the dialog will automatically pick up that identifier as the default name of the Name. Watch:
Defined Names can be managed via the Name Manager found under the Data menu. The dialog supports changing a Name, Scope, the Refers To cell range, and adding a Comment. Right-clicking allows you to Insert a new Name or Delete an existing one.
As I said in the intro, Names can be used in a number of places, most notably in various types of formula. They are very simple to use — just put them into the formula like this …
total(MyName) + stddev(MyName)
MyName is a Name pointing to a range of cells in a column.
Remember scope! The Name is only valid for the scope it is defined for! In fact, we have found that setting Names to Book-level scope is the most practical and useful scope.
Names as Input for Analyses
Names can also be used as input for many types of analyses. In the example below, I’m using two Names (
polyorder) in the Smooth dialog. If I update the value of either of those Names, the analysis operation will recalculate based on the new value.
Bonus Feature- Names as Functions
Lastly, Names can be used as “lookup functions” for XY column pairs. The idea is that, if you define a Name on an entire Y column, you have the option to Define as Function that Name. Origin will then associate that Y column’s X column forming a “lookup mechanism” for values in the Y column. By default it’s doing linear interpolation. But you can also enter MyFunc(C, bspline) for bspline interpolation.
In the following animation, I Define as Function a Name based on column B. Then, I use that Name as a function in column D to look up values from B based on values in C. It’s easiest to watch!
Well that’s a quick introduction to Names in Origin 2022. Thanks for reading!