官术网_书友最值得收藏!

  • Minitab Cookbook
  • Isaac Newton
  • 418字
  • 2021-07-16 12:29:21

Cleaning up a text column with the calculator

In the dataset shown in the following screenshot, volunteers are listed with their first and last names:

Cleaning up a text column with the calculator

Throughout the column, there are errors in the capitalization of names. We will apply the correct case to the names and separate the names into new columns for first and last name.

Getting ready

Enter the names in the screenshot into a new column in Minitab. Name the column Volunteer.

How to do it…

The following instructions will use the proper word commands in the calculator to create a column of correctly capitalized surnames:

  1. In the Calc menu, click on Calculator.
  2. In the section Store result in variable, create a new column called Surname.
  3. Filter the function list by selecting the text functions from the drop-down list. Then look for the function Proper. Double-click on the function to move it into the calculator.
    How to do it…
  4. Next, find the function Word in the text function list. Double-click on this to highlight and replace the section text in the calculator. This should look like the following screenshot:
    How to do it…
  5. Double-click on the column Volunteer to bring it into the expression and replace the section labeled text.
  6. Replace word_num with 2 and delete the delimiters and brackets. The expression should look like the following screenshot:
    How to do it…
  7. Click on OK to create a column of surnames capitalized correctly.
    How to do it…

How it works…

The text function Proper returns a capital letter at the start of each word. The rest are set to lowercase. The Word function is used to locate a word in a text string. The Word 2 function finds the second word in a cell, using spaces as delimiters by default.

Nesting the Word function inside the Proper command tells Minitab to find the second word for the text in the column Volunteer and then set the first letter in each word as a capital and all others as lowercase.

There's more…

There is a list of calculator functions within the Help menu for the calculator. The text functions include a number of useful tools. Note, Item is similar to the Word function but allows the separator to be specified. For example, A_123_tx could be used with an Item function such as Item(c1,2,"_") to define the separator of the items as an underscore.

It is also worth noting that Find and Replace work in the worksheet as they do in other applications. Press Ctrl + F, and Ctrl + H or they can be found in the Editor menu.

主站蜘蛛池模板: 长汀县| 菏泽市| 宜城市| 南康市| 汝州市| 吐鲁番市| 新平| 嘉鱼县| 澄江县| 安塞县| 浦县| 大荔县| 兴仁县| 尖扎县| 湘潭县| 保亭| 田阳县| 邮箱| 通山县| 武乡县| 宁津县| 石嘴山市| 南丰县| 新昌县| 博白县| 丹凤县| 恩平市| 梅州市| 府谷县| 新和县| 瓮安县| 青田县| 庆阳市| 翁源县| 湖南省| 潮州市| 邳州市| 金山区| 徐水县| 奉化市| 延寿县|