Excel
Excel
www .ExcelTip.com
ii
Chapter 7: Formulas........................................................................... 91
Chapter 23: Using Functions and Objects to Extract Data ............ 355
Table o f Contents
Chapter 1:
Time is Money, Give Your Mouse a Break........... 1
Cell, Cells, Move and Select .................................................................. 2
Moving to the last cell in a range ....................................................... 2
Selecting a horizontal or vertical range of adjacent cells ................... 3
Selecting a range of non-adjacent cells ............................................. 4
Selecting the current region............................................................... 5
Moving the Cellpointer around a selected range ................................ 6
Selecting the first cell in a worksheet................................................. 7
Selecting the last cell in the used range ............................................ 7
Reducing the used range in a worksheet ...................................... 8
Rows and Columns ................................................................................ 9
Selecting a column or columns .......................................................... 9
Selecting a row or rows ..................................................................... 9
Adding a cell, a row, a column ........................................................... 9
Deleting a cell, a row, a column ......................................................... 9
Hiding or unhiding a column or columns ............................................ 9
Hiding or unhiding a row or rows ....................................................... 9
View More Data in Worksheet .............................................................. 10
Moving between Sheets in a Workbook ................................................ 12
Using keyboard shortcuts to move between sheets ......................... 12
Selecting a sheet from the shortcut menu........................................ 12
Jumping Quickly between Cells in a Workbook .................................... 12
Using the Name box ........................................................................ 13
Copying, Cutting and Pasting ............................................................... 13
Keyboard shortcuts.......................................................................... 14
Copying and pasting, using the mouse and keyboard ...................... 14
Cutting and pasting, using the mouse and keyboard........................ 14
Copying a cell with text or a formula to thousands of cells............... 15
Copying a cell by double-clicking..................................................... 15
Moving between Open Workbooks ....................................................... 16
vi
Chapter 14:
Opening, Closing and Saving Workbooks .......231
Opening a New Workbook.................................................................. 231
Opening a Previously Saved Workbook.............................................. 232
Opening a workbook from the recently used file list ....................... 232
Saving a Workbook ............................................................................ 233
Saving a workbook using Save As ................................................. 233
Inserting the file path for the workbook to
the title bar or the status bar.......................................................... 234
Saving Workbooks in a Customized Workspace ................................. 235
Opening workbooks saved in a workspace .................................... 236
Saving shortcuts to files/folders in Favorites (Excel 2000 or later)...... 236
Opening workbooks from a list of hyperlinks ...................................... 237
Closing a workbook / workbooks and Excel ........................................ 238
Using the Database Functions to Sum Data According to Criteria ...... 274
Disadvantage of using the Database functions .............................. 274
Unique Records ................................................................................. 275
Filtering a record into one unique record ....................................... 276
Using the COUNTIF function to filter a record into a unique record 277
Coloring a unique record ............................................................... 278
Chapt er 1
Time is Money
Give Your Mouse
a Bre a k
Is your time valuable? If you are not sure that it is, do not bother reading
this chapter – keep using the Excel menus and icons to perform common
operations. But if you do value your time, this chapter will attempt to
convince you to use the keyboard instead.
At first glance, you can’t tell what the current region is, if cells contain
formulas, how to get to the end of a range of cells containing data, if
there are totals beneath the columns, if there are comments in the cells
that you ought to read to learn about the data in the worksheet, and
more.
To select a vertical range of cells that contains data, from bottom to top,
press Ctrl+Shift+Up Arrow.
To select a horizontal range of cells that contains data, from left to right,
press Ctrl+Shift+Right Arrow.
To select a horizontal range of cells that contain data, from right to left,
press Ctrl+Shift+Left Arrow.
Example: Select a contiguous range from A1 to the end of the data
range. In the example, this is A1 through A14. Select cell A1 and press
Ctrl+Shift+Down Arrow.
To select the range A1 through D14, select cell A1 and press
Ctrl+Shift+Down Arrow. Continue to hold down the Ctrl+Shift keys and
press Right Arrow.
Note
The cells in the range of A1 through A14 and the cells from A1
through D1 contain data. The continuity of data in the vertical
cells in column A and in the horizontal cells in row 1 enables
the selection of the contiguous range. Delete the data in cell
A5, and try this technique again.
To discover which cell is the last cell in the used area in the active sheet,
press Ctrl+End.
Example: Select a worksheet, and then select cell F1000. Enter data
into the cell, and clear the cell. Now press Ctrl+Home to move to the first
cell. Move to the last cell in the used area by pressing Ctrl+End. The last
cell in the used area is F1000.
Example: In the worksheet there are about 1,000 rows of data. In order
to delete the data from row 21 through the last used cell in the
worksheet, select cell A21, press Ctrl+Shift+End, and press Del.
Unhide – select the cells above and below the hidden row, and press
Ctrl+Shift+9.
Result
Only the title row is displayed, and more rows are visible.
There are different ways to select a worksheet, aside from the (annoying)
method of searching through the many worksheet tabs of a workbook.
Keyboard shortcuts
Copy Ctrl+C
Cut Ctrl+X
Paste, with the option of repeating the operation Ctrl+V
This method of copying and/or cutting using the mouse with or without
the Ctrl key is also a good method for copying/cutting rows, columns or
an entire worksheet.
Copying a sheet
Copying a sheet means copying all of the cells, including the page setup
and names.
1. Option 1 – Move the mouse pointer to a
sheet tab. Press Ctrl, and use the mouse to
drag the worksheet to a different location.
Release the mouse button and the Ctrl key.
After you move the worksheet, from the Edit menu, select
Links, and update or cancel them before you save the new
workbook. For more information, see the sections pertaining to
links in Chapter 7, Formulas.
Chapt er 2
Text
Cells in an Excel worksheet can contain different types of characters,
including text characters, numbers and dates.
Entering basic text into Excel cells is simple. It can seem complicated if
you want to do any of these tasks:
Enter a large amount of text, perhaps a few paragraphs in a cell.
Edit text once it is entered.
Mix formatting in a single cell, i.e., having bold and non-bold text in a
single cell.
Formatting
Drawing
Picture
Shadow Settings
3-D Settings
WordArt
NEW
Excel 2002 includes 3 new toolbars: IN 2002
Borders
Drawing Canvas
Power Formatting
A significant addition to the set of toolbars is the Border Toolbar. The
icons on the toolbar make it easy for you to draw borders, fill cells in
different colors, and use different line styles to mark cell borders. You
can also erase borders quickly by turning your mouse into a pencil,
just like in graphics programs.
Using AutoComplete
When you enter text in a cell, Excel searches the contiguous data in the
current column to see if the characters you have entered match an
existing entry in that column. If it finds matching text, it will automatically
fill in the remaining characters for you. This saves you the trouble of
typing in the entire entry (only if you want to take advantage of it).
Validating data
By selecting validation criteria, you can prevent entry of incorrect data or
data that does not meet the selected criteria. This technique is discussed
in more detail later in the chapter.
Tips
Prevent moving to the next cell when you finish entering data
Press Ctrl+Enter.
Selecting a Range
Selecting a range will help you enter data efficiently. Select a range of
cells, and begin entering data. Use Enter to move from cell to cell. The
data will be entered in the range of cells selected. When you have
entered data into the last cell selected in a column, the cursor will
automatically move to the first cell in the next column of the selected
range.
Example: Select cells A1 through D5. Assuming the Enter direction is
set to down, begin entering data. After you have entered data into cell
A5, press Enter, and cell B1 will be selected automatically.
Using AutoCorrect
Choose Tools, AutoCorrect (in Excel 2002, select AutoCorrect Options).
Note
AutoCorrect shortcuts for frequently used text defined in Excel
can be used in Word. Likewise, AutoCorrect text you define in
Word will be available in Excel.
Validating Data
With data validation, Excel
validates the data entered
in a cell against the
validation criteria you
defined. If the data does
not validate, it will not be
entered into the cell.
Example: You can set criteria for a range of cells to only allow dates for
2002.
1. Select cells A1:A15.
2. Choose Data, Validation.
3. Select the Settings tab, and
in the Allow box, click Date.
4. In the Start date box, enter
1/1/2002.
5. In the End date box, enter
12/31/2002.
6. Select the Input Message
tab.
7. In the Title box, enter Date validation.
8. In the Input message box, enter the criteria or
any message you like.
9. Error Alert – Select the Error Alert tab, and in the Title box, enter
the title of the alert. In the Error message box, enter the date
validation criteria. This
error alert will appear
when the date entered
into the cell is found to
be invalid.
The Error Alert tab has three different options for alerts about errors
– Stop, Warning and Information.
The Stop option prevents you from typing data into a cell if the data
does not meet the criteria. The Warning option allows you to enter
invalid data, after acknowledging the error in the warning box shown
above. The Information option only presents information about the
criterion, but allows the user to enter invalid data.
Caution
Validation is only performed when data is entered into a cell
manually. The validation technique does not work on data
that is pasted into cells.
List
Validation by list allows you to attach lists to cells. By doing this, you
can select text from a list or enter text manually. The text will be
validated against the list, which actually serves as the validation criteria
for the text.
You can create several types of validation lists, such as a list of
company employees, customer list, account list, inventory list and others.
In the Data Validation dialog box, select the Settings tab. In the Allow
box, select List.
See the customer list in the figure below.
8. Select cell D1 and open the customer list (click the small arrow on
the right side of the cell). Select one of the customers.
7. In the Error message box, enter The value you entered already
appears in the list.
5. Click OK.
Copying validation
When copying a cell that contains validation criteria to a different cell, the
criteria are copied along with the text, formula and format.
Use Paste Special to copy only the validation criteria. To do this: copy
the cell which contains the validation, select a new cell, right-click, select
Paste Special from the shortcut menu, click Validation and then OK.
Wrapping Text
Text wrapping allows you to display multiple lines of text within a single
cell and prevents the text from spilling over into the neighboring cell.
Aside from the visual importance of keeping the text in a single cell, text
wrapping is also important when working with data. See Chapter 15,
Data.
4. Press Ctrl+1
(Format Cells).
5. Select the
Alignment tab.
6. Select Wrap text.
7. Click OK.
If you cannot see the full text, just resize the cell to make the row or
column wider or smaller.
1. Be sure that the text you typed was only entered into cell A1.
2. Select cells A1:E1.
3. Choose Edit, Fill, Justify (ALT+E+
I+J).
4. Click OK and the following message will appear: Text will extend
below selected range.
Caution
Before you click OK, check if there is data or text in the rows
below. Allowing the text to extend below that will overwrite the
existing data.
To apply the style, enter text into a cell, click the style icon, change the
style to Wrap text and press OK.
Transposing Data
Transpose is used to change a
vertical range of cells to a
horizontal range or vice versa.
1. Copy a range of cells (see
cells A1:C9 in the figure).
2. Select a cell in the current or
any other worksheet and
right-click.
The result:
Technique 1
1. Press F5, or choose Edit, Go To…
2. In the Go To dialog box, click Special.
3. In the Go To Special dialog box, select
Constants.
4. Click OK.
unselect multiple sheets, right-click the sheet tab and select Ungroup
Sheets.
Using wild cards in the Text Search
Use * as a wild card for any number of characters. The * may appear
before or after text.
Example: Searching for *CO will find Cisco or Telco.
Use ? as a wild card for a single character.
Example: searching for R?N will find Ron or Ran but not Rain.
To search for an asterisk, enter ~* in the search box.
Joining Text
You can create new text by joining text from several cells, including a
combination of linked and formatted numbers.
Explanation
The ampersand symbol (&, Shift+7) joins text the same way the + symbol
joins numbers. The quotation marks are used to add empty spaces
between them.
In the example above, a space is added between the words combined. In
cell A3, you can see the combined sentence. Combining text from
different cells results in merged text.
3. In cell A3, enter the text for invoice # 2232 from 6/15/2001.
4. In cell A4, enter the formula =A1&""&TEXT(A2,"#,##0")&""&A3.
The sentence appearing in the cell – You still owe the sum of 5K for
invoice # 2232 from 6/15/2001.
For an explanation of formatting numbers, see Chapter 3, Formatting
Numbers.
Chapt er 3
Formatting Numbers
Excel offers a wide range of numeric formats, so you can choose the one
that best suits your needs. Numeric formats are set on the number tab of
the Format Cells dialog. To display this dialog, use any of these
methods:
Press Ctrl+1.
Right click a cell and choose Format Cells.
Press Alt+O+E.
Example: A format with two places after the decimal point, with or
without the digit 0:
The format code for 50 cents:
The comma has a second use in the number format. If you place the
comma at the end of the digits, then the displayed number will be divided
by 1000 for each comma.
#,##0, will display numbers in thousands
#,##0,, will display numbers in millions
/ (forward slash) symbol – the division sign for displaying a fraction.
* (asterisk) symbol – fills in empty characters, up to the beginning of the
number.
Example: The number 4543 is displayed as $ 4,543 with the format
$ *#.##0. The $ sign is displayed on the left side of the cell, and the
number is displayed on the right side.
“TEXT” – if text characters are enclosed in quotation marks and followed
by a number format, the text is displayed and the digits are formatted.
Example: With the format “Balance” #,##0, the number 4543 is displayed
as Balance 4,543. In the worksheet cell, you only need to enter the
digits, not the text.
In the third section of the number format, display of zero values, the
resulting 0 in the cell is replaced by a dash. The five spaces you entered
position the dash in line with the hundreds place in the positive or
negative number (see cell A3 in the figure).
Tip
Is the data in the cell formatted as a date
instead of as a number?
Press Ctrl+Shift+~.
Explanation:
A positive number that is greater than 5,000 will be displayed in blue; a
negative number will be displayed in red; and positive numbers from 0 to
4,999 in black (the default is applied to the third section of the number
format).
Other valid colors are [BLACK], [CYAN],
[MAGENTA], [WHITE], [GREEN], and [YELLOW].
Conditional Formatting
With Conditional
formatting, you can
add up to three
criteria. The number
or text is evaluated
according to these
criteria before the
custom format for a
conditional number
is applied.
Select a cell or cells
in the sheet. From the Format menu, select
Conditional Formatting.
The figure illustrates three different format conditions, according to the
calculated value in the cell(s) you selected.
8 No matter which Excel version you use Excel 97, 2000, 2002 or 2003, this easy
8 You can add your own notes, reference tips and examples to any page,
personalizing it to meet your exact needs!
Author:
Joseph Rubin, CPA, has written the very successful books:
8 Financial Statements.xls
8 Mr Excel on Excel
He is the principal of the leading Excel Web site www.exceltip.com, and has more
than 25 years of financial experience in the accounting industry.
This book is for: Accountants, CPA'S, Controllers, Developers, Consultants and Instructors. Bonus CD-Rom Included
Bonus CD-Rom Includes:
8 Complete searchable eBook – easy to browse and print.
8 Sample Financial Statements in Excel workbook file.
8 Excel workbook files contain all data and formulas covered in the book.
8 Additional Bonus: A number of free Add-Ins.
Author:
Joseph Rubin, CPA, principal of www.exceltip.com is the author of the very successful book
F1 Get the Most out of Excel! The Ultimate Excel Tip Help Guide.
Joseph Rubin has more than 25 years of financial experience in the accounting industry.