ieng 423 design of decision support systems modeling with excel excel basics filtering, sorting,...

28
IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

Upload: solomon-day

Post on 25-Dec-2015

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

IENG 423Design of Decision Support Systems

Modeling with ExcelExcel BasicsFiltering, sorting, data validation, summarizing data

Page 2: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

Note about files

Through out these slides references are made to files to use to try the concepts being discussed. These files are from the CD included with the MS Excel: Step by Step book

Page 3: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Using Filters Sometimes you have more data in a

worksheet than you want to see …Takes you attention away from what

is relevant to the problem One way to deal with this issue is the

use of Filters

Page 4: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Using Filters

Note: If your primary DSS problem is one of locating, extracting or organizing records of data, rather than dynamic calculations, then the problem might be more suitably frames as a database problem

Page 5: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Using Filters But, sometimes

Using MS Access (or another DBMS) complicates the solution

MS Access has a nontrivial learning curve Your block of data is not that big You want to keep your DSS application in

Excel Your client know Excel, does not know Access ! You need to do dynamic modeling…

Page 6: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Using Filters It may make more sense to stay with

Excel

Page 7: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Using Filters Sometimes you have too much data –

rows and rows You can limit the amount of data for

your view… …or analysis You want the user to focus on a

specific subset of data

Page 8: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Using Filters Use Filter.xls from UsingFilters

subdirectory

Filters eliminate rows (whole rows) that do not meet criteria

Note: they are not permanently eliminated

Turn off the filter and they are back

Page 9: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Using Filters Select a column or a header Select Data->Filter->AutoFilter

This toggles on filtering for the selected column

Select the pull-down arrow – see filter dialog box Select value from list Top 10 Custom Show All

Page 10: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Data Validation You can control using input By setting rules for what can and cannot be

entered in a cell Improved user interface – pick from list Reduces errors

Remember Murphy’s Law - if a user can do it wrong there is good chance it will be done wrong

Page 11: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Data Validation Select cell where you want data

validation Select Data from the main toolbar… …then select Validation The Data Validation dialog box will

pop-up Select the type of data validation that

you want

Page 12: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Data Validation For the selected cell or cells you can

limit input to – A specific range of whole numbers ( 1 to 10) A specific range of decimal numbers (0.5 to

6.5) A specific date or date range (1/1/2008 to

1/15/2008) A specific time or time range (08:00 AM to

11:30 am)

Page 13: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Data Validation Validating from a list

You can an options list and only values that are in that list range can be entered in the cell or cells

Suppose in G1:G5 you have WV, VA, PA, MD, and DE

Then for Cell A1 using list validation with the rule

=G1:G5Would limit input into A1 to one of those five

state values

Page 14: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Data Validation Validating from a list

Note: the question came up in class – Can you validate from a list with the list coming from a different worksheet

In other words for A1 on sheet1 the rule =Sheet2!G1:G5 Well, the answer is no, sort of Excel 2003 specifically forbids this However, read on….

Page 15: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Data Validation Validating from a list

Suppose you have a lookup list on another worksheet (say Sheet2)

Select you validation list on Sheet2 and make is named range (like states for the state code list)

Then in the validation rule for your cell (i.e. A1) Enter an = and then the named range For example =states That works!

Page 16: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Data Validation Validating from a list

You can also set an Input prompt for the cell or cells

This prompt will show up in a balloon when you hover over the cell

You can also set a specific error message to be displayed when the user enters something that does not conform to the rule

Page 17: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS ExcelData Validation Use Sorting.xls from

ReorderingAndSummarizing folder Create a list of the days of the week

abbreviations (Mon, Tue, Wed,…) Out in the worksheet like H1:H7 Select cell to set list validation Select Data->Validation, then List from the

validation dialog box Click in Source field, then drag across your

day-of-week list range (H1:H7) Then click OK

Page 18: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Sorting and Summarizing Data Use Sorting.xls in

ReorderingAndSummarizing folder Select Range or Header for column Select range of a single column in a

table with more columns… …and sort … Excel will want to fix your sort

selection to include adjacent columns, its will say—

.. Expand Selection

Page 19: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Sorting and Summarizing Data In Sorting.xls

Select Sales -> Data -> Sort (don’t expand range– what happened)

It scrambled the data, didn’t it! Undo Sort Redo Sort, but accept expanded range …what is different?

Page 20: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Sorting and Summarizing Data What is the sort order? If you sort days of the week what do

you get What is the first day of the week –

alphabetically? …the second?

Page 21: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS ExcelSorting and Summarizing Data What is the sort order? What if you want a non-normal order

Like in day-of-week order Create a custom list

Select Tools -> Options -> Custom Lists Enter or select list then OK

Then to sort by day of week Select header or range Select Data->Sort, then on the Sort dialog box,

select Options In the Options dialog box select the appropriate

list under First Key Sort Order

Page 22: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS ExcelMaking a Data List Use Sorting.xls in

ReorderingAndSummarizing folder

Why, what is a data list Data in rows and columns belong together …like records in a set Excel 2007 calls this a table

To create a data list (can’t have a filter enabled Select a range, select Data->List->Create

List

Page 23: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Making a Data List After creating a data list Sort again

Click anywhere inside the list, then select Data->Sort – Select Sales

Sort treats list as a whole – that is, it sorted the list together

FYI – autofiltering is automatically turned on when you create a list You can turn it off it you want

Page 24: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

To get on-the-fly totals Select a range (column or row – sales

for example) Look in the autosum box on the status

bar

Change Sum to other statistic – right click on Autosum box, select Mean, Min, Max, …

Page 25: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

To add a Total row Click “Toggle Total Row” in toolbox To get a different statistic

Change to Average if you want the mean – right click in Total row cell, select Average

Page 26: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

MS Excel

Displaying Data in Collapsible Levels Sort by column that has categories–

like Week Can’t be a list The click Data->Subtotals

Complete dialog box Shows summary data for levels Controls on left side allow you to collapse

or expand levels

Page 27: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data

That is all

Page 28: IENG 423 Design of Decision Support Systems Modeling with Excel Excel Basics Filtering, sorting, data validation, summarizing data