Tải bản đầy đủ (.pdf) (96 trang)

Upgrading your skills with excel 2021

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (5.45 MB, 96 trang )

<span class="text_page_counter">Trang 2</span><div class="page_container" data-page="2">

REMY LENTZNER

UPGRADING YOUR SKILLS WITH EXCEL

French original title: Excel, remise à niveau et perfectionnement EDITIONS REMYLENT, Paris, 1ère édition, 2021

<small>The Intellectual Property Code prohibits copies or reproductions intended for collective use. Any representation orreproduction in whole or in part by any means whatsoever, without the consent of the author or his successors in titleor cause, is unlawful and constitutes an infringement, pursuant to articles L.335-2 and following of Intellectual PropertyCode.</small>

This book is dedicated to Anna and Maryvone.

I could not have written it without their support, advice, encouragements and proofreading.

Graphic illlustration : Bruno CONQUET

</div><span class="text_page_counter">Trang 3</span><div class="page_container" data-page="3">

In the same collection

Improve your PivotTables with Excel Improve your skills with Google Sheets Programming macros with Google Sheets Getting started with HTML

Getting started with JavaScript Getting started with PHP & MySQL Google Gmail online

Google Docs online Google Slides online

</div><span class="text_page_counter">Trang 4</span><div class="page_container" data-page="4">

<small>1.1.2 Workshop : a body mass index calculation1.1.3 Some reminders about the formulas1.1.4 Extracting simple statistics</small>

<small>1.2 Formulas with dates</small>

<small>1.2.1 Difference between two dates1.2.2 Information about formulas</small>

<small>1.2.3 Adding a number of months to a date</small>

<small>1.2.4 The DATEDIF function for seniority calculations</small>

<small>1.4 The $ sign in formulas1.5 Formulas with text</small>

<small>1.5.1 A strange date that turns into a valid date1.5.2 The Flash-fill feature</small>

<small>Workshop1 : displaying all the dates for year 2018Workshop2 : Colouring the rows for year 20192.2 Top/bottom rules</small>

<small>2.3 Colouring empty cells2.4 The Data Bars</small>

<small>2.5 Icon Sets2.6 Colour scales</small>

</div><span class="text_page_counter">Trang 5</span><div class="page_container" data-page="5">

<b><small>CHAPTER 3 </small></b>

<b><small>Filtering, sorting out, layouts and printing</small></b>

<small>3.1 The filters</small>

<small>3.1.1 Creating a filter</small>

<small>3.1.2 Data with a format as table3.1.3 The Total row</small>

<small>3.2 Sorting out</small>

<small>3.3 Layouts and Printing</small>

<small>3.3.1 The viewing dialogue box3.3.2 The layout settings3.3.3 Setting the print area3.3.4 Inserting page breaks3.3.5 Viewing page breaks</small>

<small>5.1 The VLOOKUP function5.1.1 Finding a text value5.1.2 The #N/A error helps5.1.3 Finding a number in a scale5.1.4 Searching with a joker *5.1.5 VLOOKUP with two conditions5.2 The INDEX/MATCH functions</small>

<small>5.2.1 The INDEX function5.2.2 The MATCH function</small>

<small>5.2.3 INDEX and MATCH together5.3 Statistics with SUMIF and COUNTIF5.4 The SUMPRODUCT function</small>

<small>5.5 Locking formulas</small>

<small>5.5.1 Locking a sheet with the menu5.5.2 Leaving cells free to edit</small>

</div><span class="text_page_counter">Trang 6</span><div class="page_container" data-page="6">

<small>5.5.3 Locking formulas with matrix5.5.4 Matrix functions.</small>

<small>5.6 Target value and data table5.6.1 The target value</small>

<small>5.6.2 Data table</small>

<small>Workshop 1 : A single-entry data tableWorkshop 2 : A double-entry data table</small>

<b><small>CHAPTER 6 Pivot tables</small></b>

<small>6.1 The structure of the source table6.1.1 Some structural constraints6.1.2 Creating a Pivot Table6.1.3 Designing a Pivot Table6.1.4 Refreshing the PivotTable6.1.5 Counting with a Pivot Table</small>

<small>6.1.6 Viewing the rows at the source of a result6.2 Calculation functions</small>

</div><span class="text_page_counter">Trang 7</span><div class="page_container" data-page="7">

Excel is a spreadsheet i.e. a calculation software that adapts to the different business lines of any company. To make a comparison with the world of medicine, we could say that Excel is a generalist program rather than a specialised one in a particular eld. Indeed, Excel allows you to work with numbers such as turnover, amounts or quantities, but also with dates. In addition it is easy to manipulate string characters such as codes or groups of letters. Lots of functions are available to manipulate dates, numbers and texts. The challenge is to learn how to use and memorize them.

Sometimes specialized knowledge is required to perform very complicated calculations. Excel can help building engineers or architects who use complex formulas to nd out strength of materials or other designs. Powerful statistics functions may be used to analyze data. But Excel is able to adapt to your needs whether you are a professional or a student.

This book is organized in two parts. The rst part (chapters 1 and 2) is a refresher course about Excel fundamentals. It is intended for people who work with the spreadsheet occasionally without real training on the subject. The aim is to review the Excel basics and carrying out formulas. You will study how to perform tests between cells with the IF function. The date formulas, the $ sign and the text manipulation will be described with lots of examples. Special attention will be paid to the notion of cells coloring thanks to the very powerful feature called "Conditional Formatting". This tool allows you to color values according to the content of a cell. For instance, if a cell contains the word "paid", then the line is automatically colored in red. Filters will be studied because they represent a signi cant part of the daily work. Indeed, it is often necessary to groups lines according to criteria. You will also enjoy the right-click that provides a contextual menu and saves a lot of time. Layouts will not be forgotten because it requires ne adjustments for printing. This part ends with the setting up of several interesting charts that can be handled with Excel.

</div><span class="text_page_counter">Trang 8</span><div class="page_container" data-page="8">

The second part (chapters 4, 5 and 6) is directed to people who already have an Excel experience. It contains more powerful functions that can offer services for data management. You will discover the searching functions as SEARCH and INDEX/EQUIV. They are the basis for grouping data scattered in several sheets. The functions SUMIF and COUNTIF will show their power in calculations with logical conditions. A small tour with SUMPRODUCT will show an original way of adding values with date conditions. You will be able to study the locking of formulas with the matrix mode and the Excel menus. For managers who like to carry out hypotheses and commercial prospective, the Target Value and Data Tables features will be real assets. Finally, the last chapter of this book will focus on Pivot Tables that are extraordinary tools for creating statistical reports.

This book is structured in six chapters.

Chapter 1 refreshes knowledge in Excel in order to calculate properly. Chapter 2 studies conditional formatting with its highlighting rules, data bars and many other features.

Chapter 3 looks at the formatting techniques to print data easily. You will also study the lters.

Chapter 4 deals with several charts : histograms, lines, trends, pie, bubble, map and others.

Chapter 5 looks at advanced functions that provide multiple services. Chapter 6 presents the Pivot Tables where examples will show the power of this feature.

I hope that this book will allow you to progress with Excel and its numerous functions. Please do not hesitate to contact me at the address if you have any comments about this book.

Enjoy your reading.

</div><span class="text_page_counter">Trang 9</span><div class="page_container" data-page="9">

The author

</div><span class="text_page_counter">Trang 10</span><div class="page_container" data-page="10">

<b>CHAPTER 1 </b>

<b>Calculating rightly</b>

Excel is usualy dedicated to calculations and thanks to its various functions and formulas, it renders countless services.

1.1 The working environment and formulas

Excel provides several menus and icons bars to work with. A set of sheets named Sheet1, Sheet2, Sheet3, etc are available. These sheets (also called tabs) can be renamed with the right-click. Each time Excel is started, a blank workbook with 3 sheets opens. You can switch from one sheet to another by simply clicking on the sheet name. Figure 1.1 shows the menu.

<i>Figure 1.1 : The Excel menu</i>

Figure 1.2 shows the working environment.

<i>Figure 1.2 : The working window.</i>

A sheet has 1,048,576 rows and the last column is XFD. The columns are labelled from left to right and arranged alphabetically: A, B, C,...Z, AA, AB, AC,...,AZ, BA....BZ, CA.. CZ....XA..XFD (16224 columns).

</div><span class="text_page_counter">Trang 11</span><div class="page_container" data-page="11">

The address A3 is the intersection of the srt column and the third row.

The address A6:A10 is a range of cells from A6 to A10.

A cell can receive a numerical value, a text, a date and the the result of a formula. You can insert a comment (right-click) to describe its content. The comment can be deleted at any time.

When you enter a value in a cell, you can change it either by double-clicking it or by pressing the F2 key. A formula always starts with the = sign or the + sign. You could write in the cell A1 the simple formula =56*2 that would make Excel look like a nice calculator. But Excel is structured to calculate with cell addresses rather than with simple values, like =A3+A9 or =(C5-C8)/F6*2%.

In a formula, you can mix the operation signs at will, parentheses, the % sign as like in mathematics.

To write a formula, you should manipulate the pointeur. It helps to create the different addresses. After the = sign, addresses will be displayed automatically. Don't forget to nish the formula with the

<i>Enter key.</i>

When you enter a formula, it is also displayed in the formula bar. A small green sign con rms the entry, while the red cross cancels it. Caution: When you write calculations that depends on several formulas, any change in a parameter automatically triggers the recalculation of all the formulas. This is the main principle of the

</div><span class="text_page_counter">Trang 12</span><div class="page_container" data-page="12">

<i>Figure 1.3 : Sales revenues</i>

To see all the formulas, perform the below procedure:

<i>Formulas / Show formulas</i>

<i>Figure 1.4 : Formulas in the sheet</i>

<i>To review the values, click again on the Show formulas icon.</i>

<i>To save time, you can copy-paste one formula with the copy handle as</i>

shown in gure 1.5.

<i>Figure 1.5 : Copying formulas</i>

The following expressions shows how to perform totals:

<i>=sum(B2:B6). Displays the total of the revenues for 2017.</i>

<i>=average(C2:C6). Displays the average of the revenues for 2018.</i>

<i>=sum(B2:B6;C2:6). Calculates the sum of the sales for the two</i>

years. A semicolon separates the two ranges of cells. Figure 1.6 shows these formulas.

</div><span class="text_page_counter">Trang 13</span><div class="page_container" data-page="13">

<i>Figure 1.6 : Statistical formulas</i>

1.1.2 Workshop : a body mass index calculation

Objective: Calculating your BMI (Body Mass Index) and displaying the

<i>conclusion, using a LookUp function that handles ranges of values.</i>

The formula for the calculation is:

<i>BMI = weight/(size * size)</i>

<i>Figure 1.7 : BMI calculation</i>

The weight and size data are distributed in cells B3 and B4 respectively. Cell B5 contains the formula for the calculation of the BMI taking the values addresses into account. Cell B6 contains the formula for searching the conclusion.

<i>The formula =LOOKUP(B5; B9:B15; C9:C15) tells Excel to nd where</i>

stands the B5 value in the range B9:B15 then nd the match in the other range C9:C15.

</div><span class="text_page_counter">Trang 14</span><div class="page_container" data-page="14">

Because the value 28 is between 25 and 30, the result is "Overweight". If you change the weight or the size, the calculations will be redone

1.1.3 Some reminders about the formulas

<i>B7. It indicates the intersection of column B and row 7.A1:B12. It means the block of cells from A1 to B12.=A1+B2. It displays the total of the two cells A1 and B2.</i>

<i>=(A2-A1)/A1*100. As many operators as required can be used.=SUM(A1:A4). Addition of the group of cells from A1 to A4.</i>

<i>=SUM(A1:B7;K9). Sum of the cells group A1 to B7 and cell K9.</i>

The semicolon is an "and".

<i>=AVERAGE(N1:N8). It calculates the average of the range of</i>

<i>=COUNTIF(A1:A7; "YES"). Counts the number of times the word</i>

"YES" appears in the range of A1 to A7.

<i>=COUNTIF(A:A; "NOP"). Counts the number of times the word</i>

"NOP" appears in column A.

<i>=COUNTIF(A:F; "OK"). Counts the number of times the word "OK"</i>

appears in column in columns A to F.

<i>=COUNTIFS(B:B;"January";C:C;600). Counts the number of times</i>

the word "January" appears in column B and the value 600

</div><span class="text_page_counter">Trang 15</span><div class="page_container" data-page="15">

appears in column C, on the same line.

<i>=SUMIF(C5:C16;">0"). Sums all positive values in the range C5:</i>

<i>=SUMIF(A1:A200;"<0"). Sums all negative values in the range A1</i>

to A200.

<i>=SUMIF(C:C; "*bet*"; G:G). Sums up the values inside column C</i>

for the word "bet" that matches in the column G. The stars are generic characters. The string "bet" can be placed at the begining or at the end of the word.

<i>=SUM(January:April!B3). It sums all B3 cells between the</i>

January and April sheets, regardless of the number of sheets placed between these two tabs.

1.1.4 Extracting simple statistics

Figure 1.8 shows how to display simple statistics from a table.

<i>Figure 1.8 : Simple statistics</i>

The following list details the different calculations of the table inside row 7.

<i>Discount calculation. A discount is calculated by multiplying a</i>

discount rate with the pre-tax value. Here, the formula is

<i>VAT calculation. A VAT is calculated by multiplying a VAT rate</i>

</div><span class="text_page_counter">Trang 16</span><div class="page_container" data-page="16">

<i>with the pre-tax value. For France, the formula is =C7*20%</i>

<i>The total for all taxes Included. It is calculated by adding the VAT</i>

value with the pre-tax value then subtracting the discount. The

<i>formula is =C7-D7+E7.</i>

The total of the column C is calculated using the SUM function.

<i>The formula is = SUM (C7:C11).</i>

The average of the column C is calculated using the AVERAGE

<i>function. The formula is = AVERAGE(C7:C11).</i>

The total for January is calculated using a SUMIF function. The

<i>formula is =SUMIF(B7:B11;"January";F7:F11). </i>

It makes a sum according to a logical condition.

The total for December is computed using a SUMIF function.

<i>The formula is =SUMIF(B7:B11 ;"December";F7:F11).</i>

<i>The total for the values > 700 in column F is calculated with theformula: =SUMIF(F:F;">700").</i>

The number of times January appears in range B7:B11 is

<i>calculated with the formula: =COUNTIF(B7:B11;"January")</i>

The number of times the word "Lectures" appears in column A

<i>is calculated with the formula: =COUNTIF(A:A;"Lectures")</i>

The total excluding October is calculated with the formula:

The average with a condition on the same column is calculated with the formula: <i>=SUMPRODUCT ( (F7:F11) *(F7:F11<AVERAGE(F7:F11) ) ). This function uses matrices</i>

placed in brackets. The * sign is not the multiplier sign but a linking operator between matrices.

1.2 Formulas with dates

Excel proposes many functions that manipulate dates. They are used in several areas: human resources, business management, industrial applications and others. When you write a date with the form

</div><span class="text_page_counter">Trang 17</span><div class="page_container" data-page="17">

<i>dd/mm/yyyy, Excel actually stores a number. Through this smart</i>

mechanism, you will be able to add or substract a value to a date. The result will be a number that you will format as a date with the menu options.

Figure 1.9 shows the today date and some calculation.

<i>Figure 1.9 : Date calculations</i>

1.2.1 Difference between two dates

Because a date is a number, you can perform a difference between two dates. The result will be a value in the general display and will represent the number of days between these two dates. It is possible to use some functions that also calculate the difference.

Figure 1.10 shows the calculations.

<i>Figure 1.10 : Difference between two dates</i>

1.2.2 Information about formulas

<i>You can study the whole formulas thanks to the Formulas menu, as</i>

shown gure 1.11.

<i>Figure 1.11 : List of Excel formulas</i>

By clicking the category, you will see a list of formulas. You can also use the Excel formula builder ( gure 1.12). Make the functions list

</div><span class="text_page_counter">Trang 18</span><div class="page_container" data-page="18">

appear then click on a function. You will be able to enter the contents of the operand.

<i>Figure 1.12 : List of Excel formulas</i>

1.2.3 Adding a number of months to a date

<i>The function EDATE allows you to add or subtract months to a date.The expression EDATE(B2;6) adds 6 months to the date in cell</i>

<i>The expression EDATE(B2;-5) removes 5 months from the date</i>

in cell B2.

<i>Figure 1.13 : Adding months to a date</i>

<i>The EOMONTH function allows you to nd dates at the end of a</i>

<i>The DAYS360 function calculates the difference between two</i>

</div><span class="text_page_counter">Trang 19</span><div class="page_container" data-page="19">

dates based on a 360-day year where 12 months of 30 days are involved. The syntax is quite simple:

<i>=Days360(StartDate;EndDate;method). The start date must be</i>

less than the end date and the method parameter can be true (European method with) or false (American method).

1.2.4 The DATEDIF function for seniority calculations

<i>There is a function called DATEDIF that is not documented in Excel</i>

formulas because it comes from Lotus. It allows you to extract information from a difference of two dates. You can choose to see the result in days, months or years according to parameters. It also enables to calculate the number of days/months or years of seniority. For instance you want to know the exact number of years, months and days of your age, as 56 and 10 months and 6 days. You will have to consider the number of full years rst, then the number of months between the last full year and the last non-full year, and nally the number of days after the last full month.

Figure 1.14 shows how to do this calculation.

<i>Figure 1.14 : Seniority calculation</i>

The following list details the different formulas.

<i>Today's date. The expression =today() is very handy and returns</i>

the current date that changes every day. If you need to display

<i>today's date by using CTRL; keys.</i>

<i>Full years. The calculation of the number of full years between</i>

<i>two dates is =DATEDIF(B1;B2;"Y") .</i>

<i>Number of months left. This number is given by the formula=DATEDIF(B1;B2;"YM").</i>

</div><span class="text_page_counter">Trang 20</span><div class="page_container" data-page="20">

<i>Number of days left. This number is given by the formula=DATEDIF(B1;B2;"MD").</i>

<i>Final formula. use both formula =B3 & " years and " & B4 & "months and " & B5 & " days old" or =CONCATENATE(B3; " years and"; B4;" months and "; B5;" days old").</i>

1.2.5 End of month

In France, since 1 January 2009, the deadline for paying the amounts due cannot exceed either 45 days at the end of the month or 60 calendar days from the date of issue of the invoice. Excel has a

<i>speci c EOMONTH function that allows you to immediately calculate</i>

the payment date of an invoice.

Figure 1.15 shows an example of how to pay an invoice at 45 days end of month

<i>Figure 1.15 : End of month calculation</i>

The syntax of EOMONTH function is as follows:

<i>=EOMONTH(starting date;number of months)</i>

If the parameter for the number of months is 0, it is considered to be the current month. With the value 1, it is 2 months, etc. For instance, if today's date is 13/01/2021, then the expression

<i>=END.MONTH(TODAY();1) will return 31/03/2021.</i>

In the calculation, the payment date is at 45 days end of month. The

<i>expression used here =END.MONTH(B2+45;0). 45 days are added to</i>

the invoice date that goes to the end of the current month. 1.2.6 Calculation according to working days

It is possible to take public holidays and week ends into account to calculate a date thanks to the function WORKDAY.

</div><span class="text_page_counter">Trang 21</span><div class="page_container" data-page="21">

Figure 1.16 shows its syntax.

<i>Figure 1.16 : The workday function</i>

In the formula, you have to de ne the range of cells that contain the holidays dates.

Figure 1.17 displays an example.

<i>Figure 1.17 : Date calculation with workdays</i>

1.3 The IF function

When you must compare values in Excel, use the IF function. With it, you evaluate values contained in cells with a logical expression. For instance, to compare two sales gures one in January and the other in February, you use an IF function with a logical condition whose

</div><span class="text_page_counter">Trang 22</span><div class="page_container" data-page="22">

result triggers two different actions. The rst will occur if the logical condition is true, the second if the condition is false.

The syntax is as follows:

<i>= IF(logical condition;action1 if the condition is true; action2 if thecondition is false)</i>

The expression =SI(C2>B2; "OK"; "HELP") displays the word "OK" if the condition C2>B2 is true. Otherwise, the expression after the 2nd semicolon is used. An if condition always contains 2 semicolons.

<i>Figure 1.18 : The IF function.</i>

1.3.1 Comparing a budget and expenditures Figure 1.19 compares a budget and expenditures.

<i>Figure 1.19 : Comparison of a budget and expenditures.</i>

If the expenses are higher than the budget then the word "ALERT" is displayed. Otherwise the remaining amount is displayed, i.e. the

</div><span class="text_page_counter">Trang 23</span><div class="page_container" data-page="23">

<i>Figure 1.20 : Data Bars</i>

<i>Data Bars come from the Conditional formatting feature. To realize</i>

these formats, follow the next steps:

Select the numerical values (B4:B7).

<i>Conditional FormattingData Bars</i>

Choose the color.

<i>The green bullet comes from a new rule, always in the Conditional</i>

<i>formatting feature. You will study it further in the book.</i>

1.3.2 Nesting IF functions

It is sometimes necessary to nest several IF because of existing several conditions in the formula. For instance, you need to nd a bonus calculated from a sale and based on the amount. Let's consider a sale value of 2500€. If it is lower than 1000, there is no bonus. If the sale value is higher than 1000 and lower than 2000, the bonus is 200.If the sale value is higher than 2000, the bonus is 500. Figure 1.21 shows the formula with several IF functions nested.

<i>Figure 1.21 : Two IF functions nested</i>

Here, two IF functions are suf cient to treat 3 conditions. Four

<i>conditions need three IF functions but beyond, the Lookup function</i>

must be used.

1.3.3 The Lookup function

It is used when a scale of prices or anything else is required.Two columns are involved. The rst one is for the scale and the second

</div><span class="text_page_counter">Trang 24</span><div class="page_container" data-page="24">

one for the result. Excel will search the value inside the scale then nd the bonus on the right column.

Figure 1.22 shows a case where 8 conditions are necessary to nd the bonus.

Between 0 and 1000, no bonus is granted. Between 1000 and 2000, 100 is granted. Between 2000 and 3000, 200 is granted. Between 3000 and 4000, 500 is granted. Between 4000 and 5000, 600 is granted. Between 5000 and 8000, 700 is granted. Between 8000 and 9000, 800 is granted. Between 9000 and 10000, 1000 is granted.

It could not be reasonable to test the conditions with multiple IF functions.

<i>Figure 1.22 : The lookup function for multiple conditions</i>

Excel considers the E3 value (5500) and searches where it can be placed in the column A. When the sale is found, the bonus from the column B is displayed in column F.

1.3.4 IF and AND

A logical expression may contain several conditions linked together. For all the conditions to be true, each one must be true. Conditions

</div><span class="text_page_counter">Trang 25</span><div class="page_container" data-page="25">

are separated with an AND operator. Figure 1.23 shows an example.

<i>Figure 1.23 : A condition IF with an AND</i>

The AND operator is placed just after the IF function. Each condition in the AND operator is separated with a semi-colon.

The conditional expression could have been written as follows: =IF(B2="english";IF(C2="south";"transfer";"training"))

But it is easier to write numerous conditions with an AND operator than with several IF nested functions

The two conditions must be true here: The language is "english".

The area is south.

The notion of nothing is materialised by two empty quotation marks: =IF(AND(B2="english";C2="south");"transfer";"")

Figure 1.24 shows the different operators you can handle in Excel.

<i>Figure 1.24 : Different operators</i>

</div><span class="text_page_counter">Trang 26</span><div class="page_container" data-page="26">

1.4 The $ sign in formulas

When you copy a formula down or elsewhere, the cell addresses change and adapt to the new rows or columns. However, it is sometimes necessary to block an address when copying it. For example, if a VAT rate is placed in a cell, its copy must not shift its position.

Let's take the following formula: =A2*(B7-B6) If you copy it down, it becomes: =A3*(B8-B7)

If you copy it to the right, it becomes: =B2*(C7-C6)

To block an address, the $ sign can be placed before the line number or before the letter in the column.

For example, the formula =A$2*(B7-B$6) blocks both rows 2 and 6. Copying this formula downwards will give: =A$2*(B8-B$6).

Similarly, the formula =$A2/G9 will block column A when copied to the right. The result will be: =$A2/H9.

This feature (that uses $ signs) is sometimes called absolute addressing. Figure 1.25 shows an example of addressing blocked when copying the formula to the right.

Tip: You can also use the F4 key several times to automatically place the $ sign when pointing addresses.

<i>Figure 1.25 : The $ sign in an address.</i>

The example below shows a formula in B6 that has been copied to

</div><span class="text_page_counter">Trang 27</span><div class="page_container" data-page="27">

the right. The B2 value must be blocked ($B2)in the formulas.

1.5 Formulas with text

Excel proposes many text manipulation functions that can be used

<i>daily. For example the LEFT function allows you to extract charactersfrom the left while the MID function makes it easy to extract</i>

characters in the middle of a word. The functions can be embedded. The list below shows different text functions and the syntax to be used.

<i>LEFT(A1;5). Extracts the rst 5 characters from the left in cell</i>

<i>RIGHT(A1;3). Extracts the last 3 characters from the right.</i>

<i>MID(A1;3;5). Extracts 5 characters from cell A1, starting at the</i>

third character.

<i>FIND("-";B2). Finds the position of the hyphen in B2 content.SUBSTITUTE(A3;"/";""). Replaces all / characters with the </i>

-character in cell A3.

<i>CONCATENATE(A1;"-";B1). Sticks the content of each part: the</i>

content of cell A1 follows with a dash then with the content of cell B1.

<i>=A1 & "@" & A4. Stick cells together.</i>

<i>PROPER(A1). Converts a text string to proper case; the rst</i>

letter in each word to uppercase and all other letters to lowercase.

<i>UPPER(D5). Converts the content of cell D5 to upper case.LOWER(F2). Converts the contents of cell F2 to lowercase.LEN(A2). Displays the number of characters of A2 cell.</i>

Figure 1.26 displays some text formulas.

</div><span class="text_page_counter">Trang 28</span><div class="page_container" data-page="28">

<i>Figure 1.26 : The text formulas</i>

The following formulas extracts part of characters from a cell.

<i>Figure 1.27 shows how to handle the LEFT, RIGHT, MID, FIND and LEN</i>

<i>Figure 1.27 : Extracting part of texts</i>

<i>=LEFT(A2;FIND(" ";A2)-1). Extracts the rstname with the LEFT</i>

<i>function, nding the position of the space with the FIND function.</i>

<i>=MID(A2;FIND(" ";A2)+1;LEN(A2)). Extracts a text portion beginning</i>

after the position of the space till the length of the text. 1.5.1 A strange date that turns into a valid date

A company codi es its dates in a text format starting with the number 1. One of the reasons is for the data international

</div><span class="text_page_counter">Trang 29</span><div class="page_container" data-page="29">

compatibility. With some text functions, invalid dates can be converted into valid format.

Figure 1.28 shows these odd dates that cannot be ltered or sorted.

<i>MID, RIGHT and DATE functions can solve the problem.</i>

<i>Figure 1.28 : Special dates</i>

It could have been possible to integrate these three functions in one

1.5.2 The Flash-fill feature

<i>Starting with Excel 2013, a new feature called Flash- ll allows you to</i>

cut texts without any formulas. The result is placed in a new column. The principle is as follows:

Place the data to be cut in one column.

In the adjacent column, enter the rst word Excel must carry out.

</div><span class="text_page_counter">Trang 30</span><div class="page_container" data-page="30">

<i>Data / Flash-Fill. Excel will immediately extract and display the</i>

words searched.

Figure 1.29 shows this innovative feature.

<i>Figure 1.29 : Flash- ll.</i>

In brief

In this chapter you have studied how to make simple or complex calculations with formulas. You have manipulated dates with dedicated functions and you can now test the cell contents with the IF function. The $ sign placed in formulas allows you to block cells when copying formulas. Finally, you have manipulated text functions to extract pieces of characters.

Chapter 2 deals with conditional formatting i.e. the automatic colouring of values.

</div><span class="text_page_counter">Trang 31</span><div class="page_container" data-page="31">

<b>CHAPTER 2 </b>

<b>Conditional formatting</b>

Conditional formatting allows groups of values to be colored according to one or more logical conditions. For example, in a salary column you can colour in red the values below 1800. It is also possible to color an entire line according to a condition thanks to a formula. This formatting features enable to analyse the information <i>Highlight Cells Rules</i>

<i>Figure 2.1 : The menu.Text that Contains</i>

Specify the text and choose the color.

</div><span class="text_page_counter">Trang 32</span><div class="page_container" data-page="32">

<i>Figure 2.2 : Highlighting speci c textOK</i>

2.1.1 Clearing rules

To clear some rules already de ned, follow the steps below: Select the cells

<i>Home / Conditional formattingClear Rules</i>

<i>Clear Rules from Selected cells</i>

Caution. When you perform several rules on the same range, they all add up to each other. It is not a bad idea to clear the rules before adding others.

2.1.2 Using a formula to highlight cells

Figure 2.3 shows a list in which each sector is colored in red only for the value de ned in the cell F2. To perform this feature, you have to write a formula in a new rule.

<i>Figure 2.3 : Highlighting text according to a cell content</i>

Select the range to be highlighted (C1:C7 or C:C).

</div><span class="text_page_counter">Trang 33</span><div class="page_container" data-page="33">

<i>Home / Conditional formattingNew Rule</i>

<i>Choose the style Classic.</i>

<i>Use a formula to determine which cells to format</i>

<i>Figure 2.4 : New Formatting Rule</i>

Type the formula that apply to the range selected. =IF($F$2=$C1;TRUE;FALSE)

It is very important to place the $ sign rightly. $C1 blocks the column C but leaves the potential highligting to the other rows. $F$2 blocks the cell F2 completely.

The parameter TRUE means that if the conditional expression is true then the color apply the cells.

The parameter FALSE means that if the conditional expression is false then the color does not apply the cells.

2.1.3 Highlighting values

It is very easy to highlight values according to several conditions proposed in the menu. Figures 2.5 and 2.6 show the different possibilities.

</div><span class="text_page_counter">Trang 34</span><div class="page_container" data-page="34">

<i>Figure 2.5 : Highlighting Cells Rules</i>

<i>Figure 2.6 : Top/Bottom Rules</i>

The example below displays in yellow all the salaries that are less than 2900.

<i>Figure 2.7 : Values highlighted</i>

<i>Figure 2.8 : A condition for highlighting</i>

2.1.4 Identifying duplicates

There are several ways to deal with duplicates. You can ignore them, delete them, or mark them with conditional formatting.

The following procedure shows how to color duplicate values.

</div><span class="text_page_counter">Trang 35</span><div class="page_container" data-page="35">

Select the cells to be coloured.

<i>Home / Conditional formattingHighlight Cells Rules</i>

<i>Duplicate valuesDuplicate</i>

<i>By choosing the other choice Unique in the the drop-down list, Excel</i>

will color the single values.

<i>Figure 2.9 : Coloring duplicates</i>

2.1.5 Highlighting dates

Excel proposes rather original choices to highlight dates ( gure 2.10).

<i>Figure 2.10 : Highlighting part of dates</i>

Here is the method to perform this type of search. Select the cells to be coloured.

<i>Home / Conditional formattingHighlight Cells Rules</i>

<i>A date occuring</i>

</div><span class="text_page_counter">Trang 36</span><div class="page_container" data-page="36">

Figure 2.11 shows some dates for the technicians last medical visit and the criteria for a research.

<i>Figure 2.11 : The last medical visit</i>

Workshop1 : displaying all the dates for year 2018 Enter the start date and the end date in column E. Select all the column B

<i>Home / Conditional formattingHighlight Cells Rules</i>

In the rst zone, point to the start date and in the second zone, point to the end date.

Workshop2 : Colouring the rows for year 2019

Figure 2.12 shows the same table with rows coloured in yellow only for the year 2019.

</div><span class="text_page_counter">Trang 37</span><div class="page_container" data-page="37">

<i>Figure 2.12 : Rows colored</i>

Select all the table (A1:B8 or A:B).

<i>Home / Conditional formattingNew Rule</i>

<i>Choose the style Classic.</i>

<i>Use a formula to determine which cells to formatType the formula</i>

Select the cells to be colored (B2:B6)

<i>Home / Conditional formatting</i>

Top/Bottom Rules

<i>Top 10 items. The 10 highest values are shown but you can</i>

choose to increase or decrease this number using a drop-down list.

<i>Top 10%. Displays 10% of the highest values. You can choose</i>

to increase or decrease this number using a drop-down list.

<i>Bottom 10 items. The 10 lowest values are shown but you can</i>

choose to increase or decrease this number using a drop-down

</div><span class="text_page_counter">Trang 38</span><div class="page_container" data-page="38">

<i>Bottom 10%. Displays 10% of the lowest values. You can</i>

choose to increase or decrease this number using a drop-down

2.3 Colouring empty cells

This option allows you to view at a glance all the cells that are not lled in.

Select the cells.

<i>Home / Conditional formattingNew rule</i>

Choose the classic style.

<i>Only format cells that contain</i>

<i>Choose Blank</i>

Choose a colour

<i>Figure 2.14 : A rule for blank cells</i>

Figure 2.15 shows blank cells coloured in green.

</div><span class="text_page_counter">Trang 39</span><div class="page_container" data-page="39">

<i>Figure 2.15 : Blank cells selected</i>

2.4 The Data Bars

Displaying Data Bars allows you to view small and large values very quickly. You will be able to analize your data better. Follow the next procedure to set up these visual bars.

Select the data.

<i>Home / Conditional formattingData Bars</i>

Select the color.

<i>Figure 2.16 : Data Bars</i>

If you want several colours, apply the Data Bars one by one. Figure 2.17 shows the different colours.

<i>Figure 2.17 : Data Bars colours</i>

<i>Select More Rules if tou want more parameters.</i>

</div><span class="text_page_counter">Trang 40</span><div class="page_container" data-page="40">

<i>Figure 2.18 : More Data Bars parameters</i>

2.5 Icon Sets

Excel can display icons according to several logical conditions.

<i>Home / Conditional formatting</i>

</div>

×