Jumat, 14 Oktober 2016

Combine Text from Multiple Cells

To combine text from multiple cells into one cell, use the & (ampersand) operator.
  1. Select the cell in which you want the combined data
  2. Type an = (equal sign) to start the formula
  3. Click on the first cell
  4. Type the & operator (shift + 7)
  5. Click on the second cell
  6. Press Enter to complete the formula
If the text is in a formatted table, the formula will show structured references, with the column names.
combine text formatted table
If the text is not in a formatted table, the formula will show cell references.
combine text cell references

Add Spaces to Combined Text

When you combine cells with text using the above formula, there is no space between the first and last names. To insert a space, or another character, you can include a text string in the formula.
  1. Select the cell in which you want the combined data
  2. Type an = (equal sign) to start the formula
  3. Click on the first cell
  4. Type the & operator
  5. Type the text string for the character that you want between the words, for example:
    • Space: " " (double quote, space, double quote)
    • Comma Space: ", " (double quote, comma, space, double quote)
    • Semi-colon Space: ", " (double quote, semi-colon, space, double quote)
    • Line break: CHAR(10)
      NOTE: Turn on Wrap Text in the cell, if using a Line Break
  6. Type the & operator
  7. Click on the second cell
  8. Press Enter to complete the formula
If the text is in a formatted table, the formula will show structured references, with the column names.
combine text space formatted table
If the text is not in a formatted table, the formula will show cell references.
combine text space cell references

Add Line Break to Combined Text

Instead of showing characters between the words, you can use the CHAR function, with 10 as its argument, to create a line break. This is the same as typing Alt+Enter in a cell that contains text.
Be sure to format the cell with Wrap Text, to see the line break..
  1. Select the cell in which you want the combined data
  2. Type an = (equal sign) to start the formula
  3. Click on the first cell
  4. Type the & operator
  5. Type CHAR(10)
  6. Type the & operator
  7. Click on the second cell
  8. Press Enter to complete the formula
  9. Format the cell with Wrap Text
If the text is in a formatted table, the formula will show structured references, with the column names.
combine text line break formatted table
If the text is not in a formatted table, the formula will show cell references.
combine text line break cell references

Combine Cells With Text and a Number

You can combine cells to join a text string with a number from a cell.
In this example, text will be added to the payment terms.
  1. Select the cell in which you want the combined data
  2. Type the formula, with text inside double quotes. For example: ="Due in " & A3 & " days"
    NOTE: To separate the text strings from the numbers, end or begin the text string with a space.
  3. Press Enter to complete the formula
combine text line break cell references

Combine Cells With Text and a Formatted Date

When you combine text with a date, you can format it by using the TEXT function. Without formatting, the date will appear as a number, as in the screen shot below
combine text date
  1. Select the cell in which you want the combined data
  2. Type the formula, with text inside double quotes, and the date inside the TEXT function. For example, to show the full weekday name, for the current date: 
    ="Today is " & TEXT(TODAY(),"dddd") 
    • In the TEXT function, the date is the first argument, and the formatting is the second argument.
    • The TODAY function returns the current date.
    • The "dddd" formats the date as the full weekday name. You can use any other valid date format, such as:
    • "mm-dd-yyyy" OR "yyyymmdd" OR "ddd mmm dd yyyy"
  3. Press Enter to complete the formula
combine text date format
NOTE: For other languages, use the applicable date codes, such as "jjjj" for the weekday name in French. To see how to switch between languages, download the sample file from the Functions section on the Excel Sample Files page. Look for FN0046 - Change Language for TEXT Function.

TEXT Function Formatting Examples

Here are a few examples of using the TEXT function to format numbers.
combine text number format
Format a date as month/day/year:
  ="Payment is due " & TEXT(A2,"mm/dd/yyyy")
Format a number as currency:
  ="Amount due: " & TEXT(A3,"$#,##0.00")& " USD"
Format a number as a percentage:
   ="Your score is " & TEXT(A4,"0.00%")
Format a number as a fraction:
   ="Hours worked: " &TEXT(A5,"# ?/?")

SOURCE : http://www.contextures.com/xlCombine01.html

0 komentar:

Posting Komentar

Masukan Komentar yang sesuai jika tidak, maka akan dianggap spam.