Skip to main content

University Library, University of Illinois at Urbana-Champaign

OpenRefine

A free, open source, powerful tool for working with messy data.

Combining Cell Values

Sometimes it is useful to combine information from multiple columns into one using a process called “concatenation.” This method allows you to combine the contents of two columns, add a specific string to a column’s values, or a combination of both.

NOTE: This function requires the use of regular expressions. The relevant expressions are provided here, but for more information, please refer to the section on Google Refine Expression Language (GREL) and the Resources page.

  1. Go to the column you would like alter and click the arrow button on the column header.
  2. Select the “Edit cells” option and then choose “Transform.”
  3. A pop-up window will appear with several sections, including a GREL expression input box and a preview panel. For more information on this window, refer to the Google Refine Expression Language (GREL) section.
  4. The expression for combining column information is:

value + cells[‘Column’].value

  • "Value" indicates the values in the current column.
  • "Column" should match the name of the column whose values you would like to combine with the current column.
  1. To combine column information AND additional strings, use a “+.” For example:

value + “-” + cells[‘Column’].value

  • Adds a dash between the values of the current column and the values of the column to be combined with the current column.
  1. Once you have typed your expression into the expression box, check the preview window to confirm that your transformation looks the way it should.
  2. There is also a section to the right of the expression box which will tell you if there are any syntax errors in your expression.
  3. When you are satisfied with the preview, select “OK.”

Process for combining cell values

Helpful Tips:

  • When inputting the name of the column you wish to combine with the current column, remember that regular expressions are CASE SENSITIVE. Nothing will happen if the column name is not exact.

5/2/2018 - Brinna Michael