Databases and Excel
What is a Database
A database is a collection of related information that is grouped as a single item.
Information in a database is normally organized and stored in a table by rows and columns.
Rows in a database file are called records
Columns are called fields.
What is a Database
In Excel you create a database by arranging all your data into rows and columns.
Each column of the spreadsheet contains a different field.
Each row contains an additional record.
Databases are the future of business and you need to be able to understand and use them.
Creating a Database
In a blank row of the worksheet, enter the desired names of the fields.
In each cell of a row directly underneath the field names, type the desired entries for that field into the cell. By sure not to leave any blank rows.
Numbers in addresses should be stored as text. To do this add an apostrophe before each record.
Creating a Database
We can also format a column of numbers, such as the Postal code to be read as text only.
Highlight the column and choose format cells and choose text from the number tab.
It is possible to create more than one database in a single worksheet, but this is normally a bad idea. Keep one database on one worksheet.
Creating a Database
You can create your database by just entering text into cells.
However, a better and easier way to enter data is to use a data form.
A data form is a form that Excel provides for you to enter and display data.
To display the data form choose Data>>Form.
Creating a Database
By using a data form you can more easily edit and enter data into your database.
You can also use the built in features of the data form to search for records that match a specified criteria.
This helps you to locate records more easily in a large database.
Finding Data
Open the data form again and click on the Criteria button.
When you do this your form changes to one that will be used to search.
Type in your search criteria and press the form button.
The first matching record will be displayed. You can move through them by using previous and next.
Finding Data
You can also use wildcards, such as a ? Mark in place of a character and asterisk to represent multiple characters.
For example I might search for H?ll which would return names such as Hall, Hill, Hull etc.
The search for *der would locate all strings of text ending in der.
Finding Data
You can also use comparison operators to located data.
Operators such as <, >, =, <>, <=, >=.
For example if you had a field expenses, you could find all expenses greater than (>) 500.
AutoFilter Command
AutoFilter can be used to retrieve a set of records based on a specified criteria.
AutoFilter will only return records matching the specified criteria.
The AutoFilter is a toggle switch, meaning that once it is turned on it remains on until you turn it off.
AutoFilter Command
To turn it on choose Data>>Filter>>AutoFilter.
A drop-down list box appears next to each field name in the database.
You can use these list boxes to filter out rows of the database that dont match specified criteria.
AutoFilter Command
The AutoFilter option has many uses, but one of the most useful is to use it to create a report from your database, that is printable, containing only certain data.
The complex criteria option, named Custom, on the drop-down list allows you to return records matching only a certain specified set of conditions.