C1 Excel
C1 Excel
C1 Excel
Lecture 1
INTRODUCTION
DATA TYPES , FORMATS, OPERATIONS, AUTOFILL
Note: No MS-DOS version of Excel 1.0 ever existed: the Windows version originated at the time the Mac version was up to 2.0.
There is no Excel 6.0, because the Windows 95 version was launched with Word 7and Excel 7 (Office 7).
Spreadsheet applications use data that are presented as tables. The information is
organized in rows and columns. Table elements are called cells and are uniquely
determined by column and line identifiers (like a chess table).
Excel application use the spreadsheet or sheet concept for table of data. This is a large
table where each cell can contain numerical information, logical data, calendar dates,
string and mathematical formulas that may have data as arguments or references to other
cells.
• Allows for the creation of computational formula in an easy manner, having regard to the aid libraries of
predefined functions (mathematics, statistical, text, engineering, databases).
• Programing modules with VBA.
• It contains graphic facilities. The charts are automatically updated to the values of the cells that are defined as
arguments.
• Data dedicated techniques : pivot tables, filters, enable aggregates (total or subtotal), building series of data,
automatic generation of data( autofill), sort the data.
• Word processing facilities.
Dimensions:
A spreadsheet can hold up to 256 columns in Excel 2003 respectively 16384 in Excel 2007 and 2010. By default
these are denoted as follows: A, B, C, ..., Z, AA, AB, ..., AZ, BA ... ... ... IA ... .. IV (XFD ). The maximum number
of rows is 65,536 in Excel 2003 (1,048,576 in Excel 2007, 2010). A cell can hold up to 32,000 characters
(alphabetic and/or numeric).
A spreadsheet file contains one or more tables, which are implicitly called Sheet1, Sheet2, .... The user can
rename the spreadsheet by displaying the context menu (right mouse click) and choose rename.
Name box
EXCEL 2007 / 2010 Formula bar Column heading
Menu bar
Ribbon
Select all
Active cell
Scroll bar
Row
Headings
↓ or Vertical arrow Select entire column respectively select entire row. Only appears
→ Horizontal arrow when the mouse is over a column or row heading.
Pointer Indicator Description
Mouse arrow with a Occurs when hover over black edges of a selection. It is used
compass shape to move contents of a cell or range of cells.
incorporated.
Fill pointer
Move pointer
Sizing pointer
There are situations where the quantity of data exceeds the active window of Excel. To view any subdomain of
the spreadsheet one may use the following methods:
Arrow keys move the selection on the cell in the up / down / right / left direction (the arrow that is used) passing
through each cell.
Another way is to drag on the vertical or horizontal scrollbars.
PgDn / PgUp allow going to the beginning of the document respectively to the end of the document by one page.
Alt + PgDn / PgUp moves to the right or left the displays window by one page.
Ctrl + Home / Ctrl + End positions at the start respectively at the end of the spreadsheet.
Ctrl + arrow means going to the edges of the spreadsheet.
Ctrl + PgUp / Ctrl + PgDn jump to the next worksheet (left / right).
Also for positioning in the spreadsheet can be used the GoTo method which is on the Home+Find&Select Excel
2010 (Edit menu for Excel 2003), or you can type Ctrl + G. On the reference text box (reference required) one
should enter the destination for column and row cell. For example we will place the A200 to go on column A row
200.
DATA TYPES
Definition:
The information we have is actually a data. There are different kinds of information thus data types can be:
numerical, alphanumerical (character), dates/time and logical (true/false). Programming languages accept
different data types that must be defined accordingly.
Each type of date works with specific operators.
Tip To quickly apply the Accounting format, select the cell or range of cells you want to format. On the Home
tab, in the Number group, click Accounting Number Format . If you want to show a currency symbol other than
the default, click the arrow next to the Accounting Number Format button and then select another currency
symbol.
When a date or time is typed in a cell, it appears in a default
date and time format. The default date and time format is
based on the regional date and time settings that are
specified in Control Panel, and changes when changes are
made to those settings. You can display numbers in several
other date and time formats, most of which are not affected
by Control Panel settings.
Obs.
If you entered a date or time then that cell will accept only
this type unless you define otherwise.
Note Date and time formats that begin with an asterisk (*)
respond to changes in regional date and time settings that are
specified in Control Panel. Formats without an asterisk are not
affected by Control Panel settings.
This will take a negative effect on some old Excel versions in
exporting/importing the data.
If you apply the Percentage format to existing numbers in a
workbook, Excel multiplies those numbers by 100 to convert
them to percentages. For example, if a cell contains the
number 10, Excel multiplies that number by 100, which means
that you will see 1000.00% after you apply the Percentage
format. This may not be what you expected.
To accurately display percentages, before you format the
numbers as a percentage, make sure that they have been
calculated as percentages, and that they are displayed in
decimal format. Percentages are calculated by using the
equation amount / total = percentage.
For example, if a cell contains the formula =10/100, the
result of that calculation is 0.1. If you then format 0.1 as a
percentage, the number will be correctly displayed as 10%.
Use the Fraction format to display or type numbers
as actual fractions, rather than decimals.
1000 1.00E+03
120000000 1.20E+08
12000.67 1.20E+04
-12300.00123 general
(12,300) custom: #,##0;[Red](#,##0)
12300.00123 general
12,300 custom: #,##0;[Red](#,##0)
A number format can have up to four sections of code, separated by semicolons. These code sections define the
format for positive numbers, negative numbers, zero values, and text, in that order:
<POSITIVE>;<NEGATIVE>;<ZERO>;<TEXT>
For example, you can use these code sections to create the following custom format:
[Blue]#,##0.00;[Red](#,##0.00);0.00;"sales "@; @ means to concatenate with the input text.
Result: 0.00 12.34 (12.34) sales Hello !
Example of custom format
Calculation operators
Operators specify the type of calculation that you want to perform on the elements of a formula. Microsoft
Excel includes four different types of calculation operators: arithmetic, comparison, text, and reference.
Types of operators
Arithmetic operators To perform basic mathematical operations such as addition, subtraction, or
multiplication; combine numbers; and produce numeric results, use the following arithmetic operators.
Formula
Result
Text concatenation operator Use the ampersand (&) to join, or concatenate,
one or more text strings to produce a single piece of text
To change the order of evaluation, enclose in parentheses the part of the formula to be calculated first. For example,
the following formula produces 11 because Excel calculates multiplication before addition. The formula multiplies 2
by 3 and then adds 5 to the result.
=5+2*3
In contrast, if you use parentheses to change the syntax, Excel adds 5 and 2 together and then multiplies the result by
3 to produce 21.
=(5+2)*3
In the example below, the parentheses around the first part of the formula force Excel to calculate B4+25 first and
then divide the result by the sum of the values in cells D5, E5, and F5.
=(B4+25)/SUM(D5:F5)
LOGICAL OPERATORS - AND
Returns TRUE if all its arguments are TRUE and FALSE if one or more argument is FALSE.
Syntax
AND(logical1,logical2, ...)
Logical1, logical2, ... are 1 to 255 conditions you want to test that can be either TRUE or FALSE.
Remarks
• The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays or references
that contain logical values.
• If an array or reference argument contains text or empty cells, those values are ignored.
• If the specified range contains no logical values, AND returns the #VALUE! error value.
A B
Formula Description (Result)
=AND(TRUE, TRUE) All arguments are TRUE (TRUE)
=AND(TRUE, FALSE) One argument is FALSE (FALSE)
=AND(2+2=4, 2+3=5) All arguments evaluate to TRUE (TRUE)
A B
1 Data
2 50
3 104
4 Formula Description (Result)
6 A B
=IF(AND(1<A2,
Displays the first number above, if it is
A2<100), A2, "The
7 between 1 and 100, otherwise displays a
value is out of
message (50)
range.")
OR
Returns TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
Syntax
OR(logical1,logical2,...)
Logical1,logical2,... are 1 to 30 conditions you want to test that can be either TRUE or FALSE.
Remarks
•The arguments must evaluate to logical values such as TRUE or FALSE, or in arrays or references that contain logical
values.
•If an array or reference argument contains text or empty cells, those values are ignored.
•If the specified range contains no logical values, OR returns the #VALUE! error value.
•You can use an OR array formula to see if a value occurs in an array. To enter an array formula, press
CTRL+SHIFT+ENTER.
A B
1 Formula Description (Result)
2 =OR(TRUE) One argument is TRUE (TRUE)
All arguments evaluate to FALSE
3 =OR(1+1=1,2+2=5)
(FALSE)
4 =OR(TRUE,FALSE,TRUE) At least one argument is TRUE (TRUE)
NOT
Reverses the value of its argument. Use NOT when you want to make sure a value is not equal to one
particular value.
Syntax
NOT(logical)
Logical is a value or expression that can be evaluated to TRUE or FALSE.
Remark
If logical is FALSE, NOT returns TRUE; if logical is TRUE, NOT returns FALSE.
A B
Formula Description (Result)
=NOT(FALSE) Reverses FALSE (TRUE)
=NOT(1+1=2) Reverses an equation that evaluates to TRUE (FALSE)
AutoFill
It is used to fill cells with data derived from information contained in the source cells. Suppose we have to
fulfill the column labeled, “reference number” of a table of 100 patients. It is a simple but very tedious
operation by doing manually step by step.
Method of operation:
Enter in the first two cells the starting values of the series. In our case type the values 1 and 2 in cells A1 or
A2.
Select the two cells.
Position the mouse in the lower right corner of the selection (the mouse pointer turns in thin black plus
shape).
Click and drag thru the destination. Destination cells can be only along the row otherwise along the column
(as the first two cells define this). In our example one will drag from cell A2 to cell A100. Thus, the
computer will automatically fill by counting down with numbers 3, 4 … and reaching 100.
If you select a single cell then the command becomes a simple copy on line or column.
Next a table with the data entered using the AutoFill method is presented.
Examples using the AutoFill
Source data AutoFill
1,2 3, 4, 5, 6, 7, …
The Ctrl key will be used for non-contiguous cell selection. First the source cells will be selected then with CTRL
key hold down select the nonconsecutive cells destination.
Next from the Edit menu choose the option: Fill then Serie. Linear type should be selected and the step value
should be inserted. Next click on the OK button.
The following example was made in the manner presented.
1 2 3 4 5 6 7
We started with the values 1 and 2 then from 3 to 7 the values were automatically filled by Fill and Series.
33
Power type series
AutoFill function works only with linear series. If we want to fill some cells with values of power
series we have to proceed as follows:
Type in the first two cells the desired values for the series you want.
Select the cells and holding down the Ctrl key define the destination. Destination cells may be
non-consecutive but must be selected on the same line otherwise in the same column defined by
the first two cells.
From the Edit group of commends choose the option Fill then Series.
Here we have to activate the Growth radio button then insert in the Step text box the desired
value (to define the series growth). As a facility one can enter a maximum numerical value to stop
uploading the series.
The trend option helps to determine the series step automatically.
Below is a power series with ratio 2 completed by this method.
3 6 12 24 48 96 192 384
Examples
Autofill – does not work for alphabet characters…..
A
B
A
B
A
If working often with a certain type of data that must be repeated, it may be possible to make custom lists -
defined by the user.
One should follow the next steps to create a custom list (Excel 2003):
Another way is to create the new list in a spreadsheet (on a line or column) and then import into logical page of
Custom Lists.
Excel 2007:
Click on Microsoft Office Button , then Excel Options.
Click on Popular, apoi Top options for working with Excel, click Edit Custom Lists.
Practical examples:
Weight ( Kg )
BMI
Height (m) 2
1.3 Weight ( Kg )
Adjusted formula : BMI
Height (m) 2.5