CAT-Wk4-8

Preview:

DESCRIPTION

cat

Citation preview

IS102 Computer as an Analysis Tool

Asst Prof. Pradeep VarakanthamSIS 5026

Ph: 6828 0519Email: pradeepv@smu.edu.sg

Data Lookup and Linkup

Administration

•Project Groups– Elias Ding Qing Hai, Rachel Yeo Shu Wen, Ting Jia Yin, Jessica Ann

Vincent– Valerie Lau, Chan Fan Jie Malcolm, Hareesha Sannareddy, Saraniya– Tan Chia An Carl, Michael Alan Lo, Jonathan Goh, Tan Yan Jie,

Daniella Koh– Lim Fei Hong, Goh Li Ching, Lee See Kai, Goh Jun Hong, Jocelyn Ho– Ler Jie Qi, Low Kai Loon, Clara Woon, Zhang Ye, Chong Haoxin– Daniel James, Mak Li Yun, Pham Nhat, Huynh Huy Tung, Jaclyn Lim

Project Fundamentals• Problem (define it well)

• Who’s facing the problem?• What solution are you looking for? • Who will benefit from the use of your model? / what benefits can

be derived from using your model?

• Analysis• Impact to the problem/business

• Use of Tools• Use the tools learnt to-date, and more as applicable

• Teamwork• I can question any member of the team on any aspect of the

project

LOOKUP() Function• Lookup(lookup_value, lookup_vector, result_vector)

– returns the corresponding result_value in the result_vector where value in the lookup_vector is the largest value but smaller than or equal to the lookup_value

lookup_value

lookup_vector

Values inlookup_vector

must bearranged in

ascending order

AB must be theLargest valueThat is smallerThan A

Bresult_vector

C

Returnresult_valueC

Types of LOOKUP Functions1. VLOOKUP()

– Searches for a value in the leftmost column of a table, and returns a value in the same row • Vlookup(lookup_value , table_array, col_index_num, range_lookup)

table_array

AA

lookup_value

B

col_index_num

B

Returned value

Types of LOOKUP Functions2. HLOOKUP()

– Searches for a value in the leftmost row of a table, and returns a value in the same column• Hlookup(lookup_value, table_array, row_index_num, range_lookup)

table_array

AA

lookup_value

B

row_index_num

B

Returned value

Types of LOOKUP Functions• Range_Lookup

– TRUE or omitted = values in leftmost column must be arranged in ascending order and vlookup returns an approximate value, that is, the next largest value that is less than or equal to the lookup_value is returned

– FALSE = values in leftmost column need not be arranged in ascending order and vlookup returns an exact match value when one is found, else returns #NA

• Exercises: DataLookUp.xls

MATCH() Function• MATCH(lookup_value, lookup_array, match_type)

• Returns the relative position of an item in an array that matches a specified value in a specified order. Use MATCH instead of LOOKUP functions when you need the position of an item in a range instead of the item itself

• match_type = 1: – returns the largest value that is less than or equal to lookup_value.

Lookup_array must be placed in ascending order • match_type = 0:

– returns the first value that is exactly equal to lookup_value.

Lookup_array can be in any order.

• match_type is -1: – returns the smallest value that is greater than or equal to

lookup_value. Lookup_array must be placed in descending order

INDEX() Function• INDEX(array, row_num, column_num)

• returns the value of an element in a table or an array, selected by the row and column number indexes

• If array contains only one row or column, the corresponding row_num or column_num argument is optional

• If array has more than one row and more than one column, and only row_num or column_num is used, INDEX returns an array of the entire row or column in array (entering 0 for the column_num or row_num respectively)

– INDEX(D2:D232,MATCH(G33,C2:C232,0))

Returns the position of thecountry by exact match

column array = row_num

Comparing Functions• INDEX() and MATCH()

• Returns value by using position found by MATCH()

• VLOOKUP()• When range_lookup is set to FALSE (exact match), returns

value by exactly matching look_up value with lookup_table• When range_lookup is set to TRUE (approx. match), returns

value by matching look_up value with the largest value in the lookup_table that is less than or equal to lookup_value. May return wrong answer if look_up table is not arranged in ascending order

• LOOKUP()• returns value by matching look_up value with the largest value

in the lookup_table that is less than or equal to lookup_value. May return wrong answer if look_up table is not arranged in ascending order

Importing External Data1. By copying and pasting

• Note that sometimes we may need to convert text to columns

• Data > Text to Columns

2. By going to website and making a selection• Data > Get External Data From Web > New Web Query

• Enter website and click “Go”

• Identify data you want by selecting on the arrows

• Click on “Import” to directly importing the data into worksheet

• Or you can create a query file to allow for future importing, by clicking the “Save Query” button (next to the options… button)

• http://moneycentral.msn.com/investor/external/excel/rates.asp

3. By using query file• Data > Import External Data > Import Data…

• Select the query file

• Exercise: DataImport.xls

Exercise – Echo Office Supplies• Compute projected sales before price discount

– Use Vlookup() to compute for each cell in the Data Section

– Use Sum() to perform appropriate summing up for “All” in Data Section, and for each cell in Summary Section

– Construct Data > Validation for customer selection in Lookup Section

– Use Match() and Index() to display information of selected customer

• Exercise: EchoOfficeSupplies.xls

Exercise – Echo Office Supplies• Before Price Discount

• Display information about selected customer

B14 = INDEX($B$23:$E$72,

MATCH($A14,$A23:$A72,0),

MATCH(B$13,$B22:$E22,0))

array

Returns the row position of the customer by exact match

= row_num

Returns the column position of “All” by exact match

= column_num

Exercise – Echo Office Supplies• Discounted Prices

• Customer Types: Big Customer (5 pax) and Other Customer (45 pax)– Projected demand – achievable– Drop projected revenue for big customers by as much as

9%– Drop projected revenue for other customers by as much

as 5%– Drop prices for all customers, but at least 8% for the big

customers• Tricky here!! How to set new discounted price for big customers and yet

not affect the decision of other customers??

Solver – Adding Reference File• Solver is an Add-in and its Reference File

connection may be lost when Excel files built with Solver is run on different computers

• Need to re-link connection

• If still cannot work,– Go to Excel

• Select Office Button > Excel Options > Add-in

Reminders• Review today’s class exercises

• Assignment 2 due next week

• Start working on your project !!!!