The following examples show how to use a **concatenate if** formula in Excel.

**Example 1: Concatenate If (By Column)**

Suppose we have the following data in Excel:

We can use the following formula to concatenate cells in column A and B only if the value in column B is equal to “Good”:

=CONCAT(IF(B2="Good", A2:B2, ""))

The following screenshot shows how to use this formula in practice:

If the cell in column B is equal to “Good” then the value in column C is equal to the concatenation of the cells in column A and B.

Otherwise, this formula simply returns a blank value.

**Example 2: Concatenate If (By Row)**

Once again suppose we have the following data in Excel:

We can use the following formula to concatenate all of the cells in column A where the value in column B is equal to “Good”:

=CONCAT(IF(B2:B7="Good", A2:A7, ""))

The following screenshot shows how to use this formula in practice:

Notice that the value in cell **C2** is the result of concatenating every value in column A where the corresponding value in column B is equal to “Good.”

**Note**: You can find the complete documentation for the **CONCAT** function in Excel here.

**Additional Resources**

The following tutorials explain how to perform other common tasks in Excel:

Excel: How to Remove Specific Text from Cells

Excel: How to Delete Rows with Specific Text

Excel: How to Check if Cell Contains Partial Text

Excel: How to Check if Cell Contains Text from List