Vous êtes sur la page 1sur 21

Functions

A function is a predefined formula that performs calculations using specific values in a particular order.

VLOOKUP
Basically, VLOOKUP lets you search for specific information in your spreadsheet. For example, if you have a list of products
with prices, you could search for the price of a specific item.

The fourth argument tells VLOOKUP whether to look for approximate matches, and it can be either TRUE or FALSE. If it is
TRUE, it will look for approximate matches. Generally, this is only useful if the first column has numerical values that have
been sorted. Because we're only looking for exact matches, the fourth argument should be FALSE.
=VLOOKUP("Photo frame", A2:B16, 2, FALSE)
Note: It's important to know that VLOOKUP will always search the first column in this range. In this example, it will search
column A for "Photo frame". In some cases, you may need to move the columns around so the first column contains the
correct data.

=VLOOKUP(A3, Products!$A$2:$C$100, 2, FALSE)


Where
Products is the other Sheet name, in the same Excel File.

COUNTA
COUNTA simply looks at a range of cells and tells you how many of the cells contain data.

In this case, we only need one argument: the range of cells we want COUNTA to look at.

=COUNTA(C2:C100)
CONCATENATE
CONCATENATE lets you combine two or more things in one cell

=CONCATENATE(B2, “ ”, A2)
Let's say we want it to say We have 25 apples. We'll just need to add an argument at the beginning that says We have:

=CONCATENATE(“We have ”, F17, “ ”, F16)


PROPER
It capitalizes the first letter of every word in a cell.

=PROPER(A2)

Great! Now all the names of the award nominees are correctly capitalized in the spreadsheet. There's one problem, though:
We still have the original uncapitalized names in column A. We can't delete column A because our formula in column B refers
to it. Instead, we can copy the values from column B into a new column by using the Paste Values feature in Excel.

To do this, select cells B2:B14 and click the Copy command (or press Ctrl+C on your keyboard). Then right-click the cell where
you want to paste the values (C2, for example), then select the Values button from the menu that appears. If you're using
Google Sheets, you can right-click and go to Paste special > Paste values only.
Now we have a column that displays the corrected names but that doesn't depend on a formula or cell reference. This means
we can delete our original columns (column A and column B). There we have it: a nice, neat spreadsheet with all the names of
the nominees correctly capitalized.

SUMPRODUCT
SUMPRODUCT can have any number of arguments, but it will usually have two.

=SUMPRODUCT(B2:B9, C2:C9)
If you could look "under the hood" of the SUMPRODUCT function, you would see that this is what it is actually calculating:

=(B2*C2)+(B3*C3)+(B4*C4)+(B5*C5)+(B6*C6)+(B7*C7)+(B8*C8)+(B9*C9)

Optional; To find Weighted Average.


=SUMPRODUCT(B2:B9, C2:C9)/SUM(C2:C9)
If one function is nested inside another function, the innermost function will be calculated first. For example, in the formula
=WORKDAY(TODAY(),3), the TODAY function will be calculated first.

IF Function

Switch to formula view


If you have a lot of formulas and functions in your spreadsheet, you may want to switch to formula view to see all of them at
the same time. Just hold the Ctrl key and press ` (grave accent). The grave accent key is usually located in the upper-left corner
of the keyboard. Press Ctrl+` again to switch back to normal view.
Formatting
Using number formats correctly

Currency Formatting
Percentage formats

a percentage can also be written as a decimal. So 15% is the same thing as 0.15, 7.5% is 0.075, 20% is 0.20, 55% is 0.55, and so
on.
Double-check your values after applying number formatting: If you apply number formatting to existing data, you may have
unexpected results. For example, applying percentage (%) formatting to a cell with a value of 5 will give you 500%, not 5%. In
this case, you'd need to retype the values correctly in each cell.

If you want your data to appear exactly as entered, you'll need to use the text number format. This format is especially good
for numbers you don't want to perform calculations with, such as phone numbers, zip codes, or numbers that begin with 0: for
example, "02415". For best results, you may want to apply the text number format before entering data in those cells.

Date formats
when you enter a date, you'll need to use a specific format your spreadsheet understands, such as month/day/year (or
day/month/year depending on which country you're in). In the example below, we'll type 10/12/2014 for October 12, 2014.
Our spreadsheet will then automatically apply the date number format for the cell.
Scenario 1: Negative Numbers:
We could filter the data to only show rows that have a negative result.
We could add conditional formatting to make the negative cells red.
We could select the data and create a chart, which will make the data more visual.
All of these solutions will work—there isn't a right or wrong answer. You may want to experiment with different methods to
see which one you think is the clearest. In our example, we’ll add conditional formatting.

First, make sure the values in column D are selected. Next, we'll need to create a conditional formatting rule that looks for
cells containing a value less than zero. The process will vary depending on which spreadsheet program you're using:

For Excel 2007-2016: From the Home tab, select Conditional Formatting > Highlight Cells Rules > Less Than.

Make sure the rule is set to "Less than" and that the value is set to "0" (to look for cells that are less than zero), and choose a
formatting option that will stand out. In this case, a red background with red text is a good choice.
another option would be to apply a Currency number format that will make the negative numbers appear as red text.

Scenario 2: Use a table:


First, we'll select our product information and then convert it to a table.
For Excel 2007-2016: Go to Insert > Table.
Next, we'll name the table. In this example, we'll give it the name: ProductsList. Note that table names cannot contain spaces.
Now let's go back to our VLOOKUP function. Rather than telling VLOOKUP to search in a specific range on the Products
worksheet (Products!$A$2:$C$100), we can simply type the name of the table (ProductsList).

So here's our new function:

=VLOOKUP(A3, ProductsList, 2, FALSE)


If anyone ever adds information to the table, the VLOOKUP function will include it automatically
Scenario 3: Data Validation/Drop Down Menu:
Data validation in Excel
Since we already have a list of shipping options in the Shipping worksheet, we're going to tell Excel to use the data in that list
to control which values a user can select. But before we do this, we'll actually need to name the cell range first. Naming cell
ranges is one way to keep track of important cell ranges in your spreadsheet.

1. Select the cell range you wish to name. In this example, we'll select the cell range A2:A10 on the Shipping worksheet (we're
including empty rows just in case more shipping options are added later on).
2. Go to the Formulas tab, and then click Define Name.

3. A dialog box will appear. Type a name for the cell range in the Name: field and then click OK. In our example, we'll name it
ShipRange.

4. Click OK. The cell range will be named.

If you ever add more data to your spreadsheet, you can easily check all of your named ranges with the Name Manager to
make sure they are including all of the data.
To create a data validation drop-down list (Excel 2007-2016):
1. Select the cell where you want the drop-down list to appear. In our example, that's cell E6 on the Invoice worksheet.
2. On the Data tab, click the Data Validation command.
3. A dialog box will appear. In the Allow: field, select List.

4. In the Source: field, type the equals sign (=) and the name of your range, and then click OK. In our example, we'll type:
=ShipRange.
5. A drop-down arrow will appear next to the selected cell. Click the arrow to select the desired option. In our example, we'll
select Standard. Alternatively, you can type the shipping option, but Excel will only accept it if it is spelled correctly.

6. The selected value will appear in the cell. Now that we're searching for the exact name of a shipping option, our VLOOKUP
function is working correctly again.

Vous aimerez peut-être aussi