Combine text from two or more cells into one cell

Combine text from two or more cells into one cell

Applies To: Excel 2016 Excel 2013 Excel 2010 Excel 2007 Excel 2016 for Mac More...

You can combine text from two or more cells into one cell. For example, if you have one cell in your worksheet with a person’s first name and one cell with their last name, you can combine them in another cell. In this topic, we'll discuss several different methods for doing this.

Flash Fill

If you have a lot of rows of data where you want to combine text, you don’t have to repeat the above procedure for every row. For example, if column A contains peoples’ first names and column B has all their last names, and you want to fill column C with all their first and last names combined, you can simply start typing the combined text in column C and Excel will fill in the rest for you.

  1. Click the cell where you want to put the first set of combined text.

  2. Type the combined text.

  3. Press ENTER.

  4. Type the next set of combined text. Excel will show you a preview of the rest of the column filled in with your combined text.

  5. To accept the preview, press ENTER.

Note: Flash Fill is only available for Excel 2013 for Windows and later.

 
Ampersand (&)(I will use it)

Using the Ampersand symbol, which you can enter with Shift+7, is the simplest way of joining cell contents. In the following example, we'll use =A2&" "&B2 to join first and last names.

  1. Click the cell where you want to put the combined text.

  2. Type =, then click the cell that contains the first text you want to combine, such as a person’s first name.

  3. Type &” “& (a space enclosed in quotation marks).

  4. Click the next cell with the text that you want to combine, such as the person’s last name, then press Enter.

    Tip:  To combine the text from more than two cells, continue selecting cells, and typing &” “& after each cell you select. If you don’t want to add a space between the combined text, type & instead of &” “&. To add a comma, type &”, “& (a comma followed by a space, both enclosed in quotation marks).

 
CONCAT function

Instead of using the Ampersand (&), you can use the CONCAT function.

Example

The example may be easier to understand if you copy it to a blank worksheet.

  1. Select the text in the example, starting with “First name” and ending with the phone number in the last row.

  2. Press Ctrl+C to copy the text.

  3. In a blank worksheet, select cell A1, and press Ctrl+V.

First name

Last name   

Phone

 

Steve

Riley

555-1875 ext. 2007

 

Terry

Adams

555-2306

 

Jim

Hance

555-1896

 

Wendy

Wheeler

555-2307 ext. 705

 

Function

=CONCAT(A2," ",B2," ",C2)

   

Result:

Steve Riley 555-1875 ext. 2007

   

The formula in the Function column of the preceding example table uses the CONCAT function to combine the contents of three cells in columns A, B, and C. In the function, you separate the cells or strings that you want combined by commas. To add a space between the strings, include a space enclosed in quotation marks (" "). If you look at the CONCAT function in the formula, you’ll see that the contents of A2 are combined with a space, the contents of B2, another space, and the contents of C2.

After you paste the example into your worksheet, drag the formula in D2 down to cells D3:D5 to combine the contents of those cells.

Note: Some browsers put an apostrophe (') in front of copied formulas, which makes Excel see them as text. If the formula displays as text instead of the result after you paste it, select the formula cell, then press F2, delete the apostrophe and press Enter.

Here’s a similar example that uses the CHAR function to insert a new line. These results are better suited for a mailing label.

First name

Last name   

Street address

City

State

Zip code

Steve

Riley

4567 Main St.

Buffalo

NY

98052

Function:

=CONCAT("The ",B2," Family",CHAR(10),C2,CHAR(10),D2,", ",E2," ",F2)

       

Description:

Combines the last name with the words "The" and "Family" and then combines the address with it. CHAR(10) is used to insert a new line. You will need to set the cells to wrap text for the new line to display properly.

       

Result:

The Riley Family
4567 Main St.
Buffalo, NY 98052

       

 
TEXTJOIN function
 

Need more help?

You can always ask an expert in the Excel Tech Community, get support in the Answers community, or suggest a new feature or improvement on Excel User Voice.

See Also

Overview of formulas in Excel

How to avoid broken formulas

Find and correct errors in formulas

Excel keyboard shortcuts and function keys

TEXT functions (reference)

Excel functions (alphabetical)

Excel functions (by category)

OFFICE_EXCEL_Combine text from two or more cells into one cell.的更多相关文章

  1. C# WinForm 导出导入Excel/Doc 完整实例教程[使用Aspose.Cells.dll]

    [csharp] view plain copy 1.添加引用: Aspose.Cells.dll(我们就叫工具包吧,可以从网上下载.关于它的操作我在“Aspose.Cells操作说明 中文版 下载 ...

  2. NPOI、MyXls、Aspose.Cells 导入导出Excel(转)

    Excel导入及导出问题产生: 从接触.net到现在一直在维护一个DataTable导s出到Excel的类,时不时还会维护一个导入类.以下是时不时就会出现的问题: 导出问题: 如果是asp.net,你 ...

  3. (转)Aspone.Cells设置Cell数据格式 Setting Display Formats of Numbers and Dates

    Setting Display Formats Using Microsoft Excel: Right-click on any desired cell and select Format Cel ...

  4. C# WinForm使用Aspose.Cells.dll 导出导入Excel/Doc 完整实例教程

    1.添加引用: Aspose.Cells.dll(我们就叫工具包吧,可以从网上下载.关于它的操作我在“Aspose.Cells操作说明 中文版 下载 Aspose C# 导出Excel 实例”一文中的 ...

  5. iOS:通过Self-Sizing Cells新特性自动计算cell的高度

    iOS8 新特性Self-Sizing Cells,自动计算cell的高度 一.简单介绍 UITableView是iOS开发最常用的一个控件,通过代理和数据源方法,几乎能实现各种各样的列表功能.在这里 ...

  6. Table View Programming Guide for iOS---(六)---A Closer Look at Table View Cells

    A Closer Look at Table View Cells A table view uses cell objects to draw its visible rows and then c ...

  7. 利用Aspose.cells 将查询出的数据导出为excel,并在浏览器中下载。

    正题前的唠叨 本人是才出来工作不久的小白菜一颗,技术很一般,总是会有遇到一些很简单的问题却不知道怎么做,这些问题可能是之前解决过的.发现这个问题,想着提升一下自己的技术水平,将一些学的新的‘好’东西记 ...

  8. 对Aspose.Cells Excel文件操作的扩展

    工作中对Excel操作的需求很是常见,今天其他项目组的同事在进行Excel数据导入时,使用Aspose.Cells Excel 遇到了些问题. 刚好闲来不忙,回想自己用过的Excel文件操作,有NPO ...

  9. iOS UITableView 与 UITableViewController

    很多应用都会在界面中使用某种列表控件:用户可以选中.删除或重新排列列表中的项目.这些控件其实都是UITableView 对象,可以用来显示一组对象,例如,用户地址薄中的一组人名.项目地址. UITab ...

随机推荐

  1. P3066 [USACO12DEC]逃跑的BarnRunning Away From (树上二分)

    题意 给出以1号点为根的一棵有根树,问每个点的子树中与它距离小于等于l的点有多少个. 树上二分.这个做法还是基于树上差分的,也就是对于每一个点uu,我们要找到它向上跳LL的长度最高能够跳到的祖先.(当 ...

  2. HDU - 3336 next运用+递推

    题目的匹配应该也要看成一个文本串与另一个模式串的匹配过程 Text是以当前i结尾的后缀来匹配Pattern的前缀(非真) 这里的Pattern肯定是可以匹配成功的,直接由next来保证(next总是当 ...

  3. vm中centos7磁盘扩容

      在VM虚拟平台管理客户端,将虚拟机关机后,将分配的磁盘大小30G扩至300G.如图.   调整完后,重新打开虚拟机,使用fdisk -l查看,可以看到我们刚刚扩容的空间已经可以看到,但没有分区,还 ...

  4. Mysql 忘记密码----修改Navicat的连接密码--以及--(加入安装Navicat时没设置密码)有时新建连接设置密码,连接不成功---的问题解决方法

    密码忘记的解决 可以参考http://jingyan.baidu.com/article/454316ab4e9e65f7a7c03ad1.html 1.安装路径(复制安装路径) 2.打开cmd命令提 ...

  5. python--交互器,编译器

    1在写python的时候调交互器的作用 唯一作用:调试代码 2.编译器

  6. java 简单的des加密示例

    1.加密结果 包含 : 对int加密 .对string加密.对byte[]加密. 10-09 18:33:32.484 7617-7617/com.example.tt.downtest D/Ciph ...

  7. 4.整体架构和Smart Scan

    寻道时间: 外圈,比内圈要多, 即外圈是比较快的. 第一次创建grid disk 时,是创建外圈,用于存放数据的,内圈存储归档这些数据 CellCLI> CREATE GRIDDISK ALL ...

  8. Android四层架构

    Andrid系统的体系结构设计为多层结构,这种结构在给用户提供安全保护的同时还保持了开放平台的灵活性.如下图所示:   Google官方提供的Android系统的四层架构图 从上到下进行简单介绍: 一 ...

  9. GCD - Extreme(欧拉函数变形)

    题目链接:https://vjudge.net/problem/UVA-11426 题目大意: 给出整数n∈[2,4000000],求解∑gcd(i,j),其中(i,j)满足1≤i<j≤n. 的 ...

  10. java多态的具体表现实例和理解

    Java的多态性 面向对象编程有三个特征,即封装.继承和多态. 封装隐藏了类的内部实现机制,从而可以在不影响使用者的前提下改变类的内部结构,同时保护了数据. 继承是为了重用父类代码,同时为实现多态性作 ...