Вы находитесь на странице: 1из 20

Excel CONCATENATE Function

Summary
The Excel CONCATENATE function concatenates (joins) join up to 30 text items
together and returns the result as text. The CONCAT function replaces CONCATENATE
in newer versions of Excel.
Purpose
Join text together
Return value
Text joined together.
Syntax
=CONCATENATE (text1, text2, [text3], ...)
Arguments
 text1 - The first text value to join together.
 text2 - The second text value to join together.
 text3 - [optional] The third text value to join together.
Usage notes
The CONCATENATE function concatenates (joins) join up to 30 text items together and
returns the result as text. In the latest versions of Excel, CONCATENATE function is
deprecated in favor of the CONCAT function, which is more flexible.
Examples

In the example shown, the following formula returns the string "Apples and Pears":
=CONCATENATE(B5," and ",C5) // returns "Apples and Pears"
When you concatenate dates, times, and other numeric values, you'll lose number
formatting. Per the example shown, you can use the TEXT function to apply formatting
like this:
=CONCATENATE(B7,TEXT(C7,"mmmm")) // returns "Month: July"
Notes

 CONCATENATE can join up to 30 text items together.


 Text items can be text strings, numbers, or cell references that refer to one cell.
 Numbers are converted to text when joined. If you need to specify a number format for a
number being joined, see the TEXT function.
 The ampersand character (&) is an alternative to CONCATENATE. The result is the
same, but the ampersand is more flexible, and creates formulas that are shorter and
(arguably) easier to read.

Creating an Excel Table


After your data is organized, as described above, you're ready to create the formatted
Table.

1. Select a cell in the list of data that you prepared.


2. On the Ribbon, click the Insert tab.

3. In the Tables group, click the Table command.


4. In the Create Table dialog box, the range for your data should automatically
appear, and the My table has headers option is checked. If necessary, you can
adjust the range, and check box.
5. Click OK to accept these settings.
Sort and Filter the Data
Your list is now an Excel Table, and is automatically formatted with a default Table
Style, which you can change. The heading cells have drop down arrows that you can use
to sort or filter the data.
NOTE: In Excel 2013 and later, you can use Excel Table Slicers to quickly filter the
table data.

Rename an Excel Table


When it is created, an Excel table is given a default name, such as Table 3. You should
change the name to something meaningful, so it will be easier to work with the table
later.
To change the table name:

1. Select any cell in the table


2. On the Ribbon, under the Table Tools tab, click the Design tab.

3. At the far left of the Ribbon, click in the Table name box, to select the existing
name
4. Then, type a new name, such as Orders, and press the Enter key

Create an Excel Table With Specific Style


When you create a table with the Table command on the Ribbon's Insert tab, the table
retains any formatting that it currently has, and the default Table Style is applied.
If you want to apply a specific table style when creating an Excel Table:

1. Select a cell in the list of data that you prepared.


2. On the Ribbon, click the Home tab.
3. In the Styles group, click Format as Table
4. Click on the Style that you want to use

OR, to apply a Style and remove any existing formatting, right-click on a Style,
and click Apply and Clear Formatting
5. In the Create Table dialog box, the range for your data should automatically
appear, and the My table has headers option is checked. If necessary, you can
adjust the range, and check box.
6. Click OK to accept these settings.

A formatted Excel Table is created, with the selected Table Style.

Show Totals in a Table


After you create an Excel table, it's easy to show the total for a column, or for multiple
columns, using a built-in Table feature.
To show a total:

1. Select any cell in the table


2. On the Ribbon, under the Table Tools tab, click the Design tab
3. In the Table Style Options group, add a check mark for Total Row

4. A Total row will be added at the bottom of the table, and one or more column of
numbers might show a total.

Change and Add Totals


In addition to the automatically created totals, you can select totals for other columns.

1. Click in the Total cell for one of the columns.


2. From the drop down list, select the function that you want to use in the current
column.
A SUBTOTAL formula is added to the cell, and it shows the calculation based on the
visible cells in the table's column.

Refer to Table Column in Formula


When a formula refers to part of a named Excel Table, a Structured Reference is created.
The Structured Reference will show the table's column name, and might include the table
name. For example, this reference is to the Product column in a table named OrderRef --
OrdersRef[Product]

Formula Outside the Table


In this example, a formula will be created outside of the table. The formula will use
the COUNTBLANK function to count the blank cells in a table column. The table is
named OrderRef and the column is named Product.

1. To start the formula, select a blank cell and type: =COUNTBLANK(


2. Then, click at the very top of the heading cell, for the column that you want to
check -- the pointer will change to a down arrow.

o Don't click on the column button where the column letter is.
o And don't click in the middle of the heading cell

3. The structured reference should show the table name and the column name:

=COUNTBLANK(OrdersRef[Product]

4. Then, type a closing bracket, and press Enter, to complete the formula.

Add a Counter Field


If you plan to use your Excel table as the source data for a pivot table, add a counter field,
that can be used in calculated fields, or summary calculations.
This is very easy to create and maintain in an Excel table, if you use a simple formula,
instead of typing the value.

1. On the OrdersTable sheet, add a new heading in first blank column -- Sales
2. In the cell below the heading, type a formula: =1
3. Press Enter, to complete the formula

Because the data is in a named Excel table, the formula will automatically fill down to all
the rows. It will also be automatically entered when you add new rows.
The 1s will give us a value that can be summed in a pivot table, or used in a Calculated
Field, to give correct results.
Excel SUBTOTAL Function

Summary
The Excel SUBTOTAL function returns an aggregate result for supplied values.
SUBTOTAL can return a SUM, AVERAGE, COUNT, MAX, and others (see table
below), and SUBTOTAL function can either include or exclude values in hidden rows.
Purpose
Get a subtotal in a list or database
Return value
A number representing a specific kind of subtotal
Syntax
=SUBTOTAL (function_num, ref1, [ref2], ...)
Arguments
 function_num - A number that specifies which function to use in calculating subtotals
within a list. See table below for full list.
 ref1 - A named range or reference to subtotal.
 ref2 - [optional] A named range or reference to subtotal.
Usage notes
Use the SUBTOTAL function to get a subtotal in a list or database. SUBTOTAL has the
ability to use a variety of functions when subtotaling, including AVERAGE, COUNT,
MAX, and others (see table below for a complete list). By default, SUBTOTAL excludes
values in rows hidden by a filter, as explained below. This makes SUBTOTAL very
useful in Excel Tables.
Below are a few examples of SUBTOTAL configured to SUM, COUNT, and
AVERAGE the values in a range. Notice the only difference is the value used for
the function_num argument:
=SUBTOTAL(109,range) // SUM
=SUBTOTAL(103,range) // COUNT
=SUBTOTAL(101,range) // AVERAGE
Available functions

SUBTOTAL behavior is controlled by the function_num argument, which is provided as


a numeric value. The table below shows available functions:

Function Include hidden Ignore hidden


AVERAGE 1 101
COUNT 2 102
COUNTA 3 103
MAX 4 104
MIN 5 105
PRODUCT 6 106
STDEV 7 107
STDEVP 8 108
SUM 9 109
VAR 10 110
VARP 11 111
Manually hidden values

Notice the values used for the function_num argument are "paired" (e.g. 1-101, 2-102,
3-103, ...). This is related to how SUBTOTAL deals with manually hidden rows.
When function_num is between 1-11, SUBTOTAL includes cells that have been
manually hidden. When function_num is between 101-111, SUBTOTAL ignores values
in rows that have been manually are hidden.
SUBTOTAL always ignores values in cells are hidden with a filter. Values in "filtered
out" rows are not included, regardless of function_num.
Notes

 When function_num is between 1-11, SUBTOTAL includes values that are hidden
 When function_num is between 101-111, SUBTOTAL excludes values that are hidden
 In filtered lists, SUBTOTAL always ignores values in hidden rows, regardless
of function_num.
 SUBTOTAL ignores other subtotals that exist in references are ignored to prevent
double-counting
 SUBTOTAL is designed to work with vertical data values arranged vertically. In
Horizontal ranges, values in hidden columns are always included.

Use nested functions in a formula

Using a function as one of the arguments in a formula that uses a function is


called nesting, and we’ll refer to that function as a nested function. For example, by
nesting the AVERAGE and SUM function in the arguments of the IF function, the
following formula sums a set of numbers (G2:G5) only if the average of another set of
numbers (F2:F5) is greater than 50. Otherwise, it returns 0.

The AVERAGE and SUM functions are nested within the IF function.

You can nest up to 64 levels of functions in a formula.

WindowsWeb
1. Click the cell in which you want to enter the formula.
2. To start the formula with the function, click Insert Function on the formula
bar .

Excel inserts the equal sign (=) for you.

3. In the Or select a category box, select All.

If you are familiar with the function categories, you can also select a category.

If you're not sure which function to use, you can type a question that describes what you
want to do in the Search for a function box (for example, "add numbers" returns
the SUM function).

4. To enter another function as an argument, enter the function in the argument box that you
want.

The parts of the formula displayed in the Function Arguments dialog box reflect the
function that you selected in the previous step.

If you clicked IF, the Function arguments dialog box displays the arguments for
the IF function. To nest another function, you can enter it into the argument box. For
example, you could enter SUM(G2:G5) in the Value_if_true box of the IF function.

5. Enter any additional arguments that are needed to complete your formula.

Instead of typing cell references, you can also select the cells that you want to reference.
Click to minimize the dialog box, select the cells you want to reference, and then
click to expand the dialog box again.

6. After you complete the arguments for the formula, click OK.

Excel SUMIF function - syntax & usage

The SUMIF function is used to conditionally sum values based on a single criteria. We
discussed its syntax in detail in the previous article, so let me give you just a quick
summary now.

SUMIF(range, criteria, [sum_range])

 range - the range of cells to be evaluated by your criteria, required.


 criteria - the condition that must be met, required.
 sum_range - the cells to sum if the condition is met, optional.
As you see, the syntax of the Excel SUMIF function allows for one condition only. And
still, we say that Excel SUMIF can be used to sum values with multiple criteria. How can
that be? By adding the results of several SUMIF functions and by using SUMIF formulas
with array criteria, as demonstrated in the examples that follow.

Excel SUMIFS function - syntax & usage

You use SUMIFS in Excel to find a conditional sum of values based on multiple
criteria. The SUMIFS function was introduced in Excel 2007, so you can use it in all
modern versions of Excel 2016, 2013, 2010 and 2007.

Compared to SUMIF, the SUMIFS syntax is a little bit more complex:

SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)

The first 3 arguments are mandatory, additional ranges and their associated criteria are
optional.

 sum_range - one or more cells to sum, required. This can be a single cell, a range of cells
or a named range. Only cells with numbers are summed; blank and text values are
ignored.
 criteria_range1 - the first range to be evaluated by the associated criteria, required.
 criteria1 - the first condition that must be met, required. You can supply the criteria in
the form of a number, logical expression, cell reference, text or another Excel function.
For example you can use criteria such as 10, ">=10", A1, "cherries" or TODAY().
 criteria_range2, criteria2, … - these are additional ranges and criteria associated with
them, optional. You can use up to 127 range/criteria pairs in SUMIFS formulas.

Important! The SUMIFS function works with AND logic, meaning that a cell in the sum
range is summed only if it meets all of the specified criteria (all the criteria are true for
that cell).

And now, let's have a look at the Excel SUMIFS formula with two conditions. Suppose,
you have a table listing the consignments of fruit from different suppliers. You have the
fruit names in column A, suppliers' names in column B, and quantity in column C. What
you want is to find out a sum of amounts relating to a given fruit and supplier, e.g. all
apples supplied by Pete.
When you're learning something new, it's always a good idea to start with simple things.
So, to begin with, let's define all the arguments for our SUMIFS formula:

 sum_range - C2:C9
 criteria_range1 - A2:A9
 criteria1 - "apples"
 criteria_range2 - B2:B9
 criteria2 - "Pete"

Now assemble the above parameters, and you will get the following SUMIFS formula:

=SUMIFS(C2:C9, A2:A9, "apples", B2:B9, "Pete")

To refine the formula further, you can replace the text criteria "apples" and "Pete" with
cell references. In this case, you won't have to change the formula to calculate the
quantity of other fruit from a different supplier:

=SUMIFS(C2:C9, A2:A9, F1, B2:B9, F2)

How to use SUMIFS in Excel - formula examples

Example 1. Excel SUMIFS with comparison operators

In our fruit suppliers table, suppose, you want to sum all deliveries by Mike with Qty.
200 or more. To do this, you use the comparison operator "greater than or equal to" (>=)
in criteria2 and get the following SUMIFS formula:

=SUMIFS(C2:C9,B2:B9,"Mike",C2:C9,">=200")
Note. Please pay attention that in Excel SUMIFS formulas, logical expressions with
comparison operators should always be enclosed in double quotes ("").

We covered all possible comparison operators in detail when discussing Excel SUMIF
function, the same operators can be used in SUMIFS criteria. For example, the following
formula with return the sum of all values in cells C2:C9 that are greater than or equal to
200 and less than or equal to 300.

=SUMIFS(C2:C9, C2:C9,">=200", C2:C9,"<=300")

Example 2. Using Excel SUMIFS with dates

In case you want to sum values with multiple criteria based on the current date, use the
TODAY() function in your SUMIFS criteria, as demonstrated below. The following
formula sums values in column D if a corresponding date in column C falls within the
last 7 days, including today:

=SUMIFS(D2:D10, C2:C10,">="&TODAY()-7, C2:C10,"<="&TODAY())

Note. When you use another Excel function together with a logical operator in the
criteria, you have to use the ampersand (&) to concatenate a string, for example
"<="&TODAY().

In a similar fashion, you can use the Excel SUMIF function to sum values in a given date
range. For example, the following SUMIFS formula adds the values in cells C2:C9 if a
date in column B falls between 1-Oct-2014 and 31-Oct-2014, inclusive.

=SUMIFS(C2:C9, B2:B9, ">=10/1/2014", B2:B9, "<=10/31/2014")

Example 3. SUM array formulas in modern Excel versions

Even in modern versions of Excel 2016, 2013, 2010 or 2007, the power of the SUM
function should not be underestimated. The SUM array formula is not simply gymnastics
of the mind, but has a practical value, as demonstrated in the following example.
Suppose, you have two columns, B and C, and you need to count how many times
column C is greater than column B, when a value in column C is greater or equal to 10.
An immediate solution that comes to mind is using the SUM array formula:

=SUM((C1:C10>=10) * (C1:C10>B1:B10))

Don't see any practical application to the above formula? Think about it in another way :
)

Suppose, you have the orders list like shown in the screenshot below and you want to
know how many products have not been delivered in full by a given date. Translated into
Excel's language, we have the following conditions:

Condition 1: A value in column B (Ordered items) is greater than 0

Condition 2: A value in column C (Delivered) in less than in column B

Condition 3: A date in column D (Due date) is less than 11/1/2014.

Putting the three range/condition pairs together, you get the following formula:

=SUM((B2:B10>=0)*(B2:B10>C2:C10)*(D2:D10<G2))

The Microsoft Excel LOOKUP function returns a value from a range (one row or one
column) or from an array.
The LOOKUP function is a built-in function in Excel that is categorized as
a Lookup/Reference Function. It can be used as a worksheet function (WS) in Excel. As a
worksheet function, the LOOKUP function can be entered as part of a formula in a cell of
a worksheet.
There are 2 different syntaxes for the LOOKUP function:
LOOKUP Function (Syntax #1)
In Syntax #1, the LOOKUP function searches for value in the lookup_range and returns
the value in the result_range that is in the same position.
The syntax for the LOOKUP function in Microsoft Excel is:

LOOKUP( value, lookup_range, [result_range]

Example (as Worksheet Function)


Let's look at some Excel LOOKUP function examples and explore how to use the
LOOKUP function as a worksheet function in Microsoft Excel:

Based on the Excel spreadsheet above, the following LOOKUP examples would return:

=LOOKUP(10251, A1:A6, B1:B6)


Result: "Pears"
=LOOKUP(10251, A1:A6)
Result: 10251
=LOOKUP(10246, A1:A6, B1:B6)
Result: #N/A
=LOOKUP(10248, A1:A6, B1:B6)
Result: "Apples"
LOOKUP Function (Syntax #2)

In Syntax #2, the LOOKUP function searches for the value in the first row or column of
the array and returns the corresponding value in the last row or column of the array.
The syntax for the LOOKUP function in Microsoft Excel is:

LOOKUP( value, array )


Example (as Worksheet Function)

Let's look at some Excel LOOKUP function examples and explore how to use the
LOOKUP function as a worksheet function in Microsoft Excel:

=LOOKUP("T", {"s","t","u","v";10,11,12,13})
Result: 11
=LOOKUP("Tech on the Net", {"s","t","u","v";10,11,12,13})
Result: 11
=LOOKUP("t", {"s","t","u","v";"a","b","c","d"})
Result: "b"
=LOOKUP("r", {"s","t","u","v";"a","b","c","d"})
Result: #N/A
=LOOKUP(2, {1,2,3,4;511,512,513,514})
Result: 512

LOOK-UP WITH SUMIF

If you work with numerical data in Excel, quite often you have not just to extract
associated values from another table but also sum numbers in several columns or rows.
To do this, you can use a combination of the SUM and VLOOKUP functions as
demonstrated below.

Suppose, you have a product list with sales figures for several months, a column per each
month.

Source data - Monthly Sales:


Now, you want to make a summary table with the total sales for each product.

The solution is to use an array in the 3rd parameter (col_index_num) of the Excel
VLOOKUP function. Here is a sample VLOOKUP formula:

=SUM(VLOOKUP(lookup value, lookup range, {2,3,4}, FALSE))

As you see, we use an array {2,3,4} in the third argument to perform several lookups
within the same VLOOKUP formula in order to get the sum of values in columns 2,3 and
4.

And now, let's adjust this combination of VLOOKUP and SUM functions for our data to
find the total of sales in columns B - M in the above table:

=SUM(VLOOKUP(B2, 'Monthly sales'! $A$2:$M$9, {2,3,4,5,6,7,8,9,10,11,12,13},


FALSE))

Important! Since you are building an array formula, be sure to hit Ctrl + Shift +
Enter instead of a simple Enter keystroke when you finished typing. When you do this,
Microsoft Excel encloses your formula in curly braces like this:

{=SUM(VLOOKUP(B2, 'Monthly sales'!$A$2:$M$9, {2,3,4,5,6,7,8,9,10,11,12,13},


FALSE))}

If you press the Enter key as usual, only the first value in the array will get processed,
which will produce incorrect results.

SUMIF WITH CONCATENATE


Data given (raw data) : quantity produced by different machines on different days

Data needed : mapping (matrix) qty produced by different machines on different days.

THE STEPS (HOW TO DO)

Step 1: Create a new column to join date and machine using "Concatenate".

Note I am using "-" to make sure no duplicates.

the formula in column (refer to the image) is =CONCATENATE(N3,"-",O3).

Make sure the formula is dragged to all the way to the bottom of the table.
Step 2: create the matrix
Manufacturing date in the column and machines in the raw (it can be done vise-
verse also)

Step 3: formula to calculate the total quantity produced by each machines on different
days.
Use sumif to do the calculation. Please note the range column and sum_range column
are different. Lets start in cell B3.
range Required. Column M (where the concatenate values are)
criteria Required. CONCATENATE($A3,"-",B$2)
sum_range Required . Column P

Let's focus on CONCATENATE($A3,"-",B$2). This formula is the same as in column


M. The main difference in freezing column and raw values. $A3 is column freeze
and B$2 is raw freeze. The freezing allow us to drag the formula.

Step 4: Drag the formula to fill up the entire table


Step 5: Check and Balance
Always good to do a check on the accuracy.

In this case SUM(B3:J12) sould be equal to SUM(P:P)

Вам также может понравиться