Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Information Technology Concepts (ITC)

Data Referencing

Prof. V S Prakash Attili

Information Technology and Systems


Indian Institute of Management, Lucknow

Restricted Access - This presentation is only for IIM Lucknow Students


Agenda
➢ Lookup functions Ch.3
➢ The INDEX function Ch.4
➢ The MATCH function Ch.5
➢ Circular references Ch.11
➢ The OFFSET function Ch.22
➢ The INDIRECT function Ch.23
➢ Filtering data and removing duplicates Ch.51
➢ CELL function
➢ Case-3: Absolute and Relative References In Microsoft Excel
➢ Summary

Restricted Access - This presentation is only for IIM Lucknow Students


Lookup functions
✓ Vertical lookup (VLOOKUP) - Starts at first column of a worksheet range
✓ Horizontal lookup (HLOOKUP) - Starts at first row of a worksheet range (optional) specify an
Contains Entire exact or approximate match
lookup table

✓ VLOOKUP syntax : VLOOKUP(lookup value, table range, column index, [range lookup])

Value you want to lookup in Column number


first column of table range in table range

✓ HLOOKUP syntax - HLOOKUP (lookup value, table range, row index, [range lookup])

Note
✓ Lookup value can be text, number, logical value, a name Or a reference
✓ If no exact match is obtained, Excel returns an #N/A (Not Available) response
✓ If the range lookup argument is True or omitted (Approximate match)
o The first column of the table range must be in ascending numerical order.
o If exact match does not exist → Excel bases the lookup on the largest value in the first column that is less than the lookup value
▪ In D13, the income of –$1,000 yields #N/A because –$1,000 is less than the lowest income level
▪ HIDE / UNHIDE : Home → Cells → Format → Visibility
Restricted Access - This presentation is only for IIM Lucknow Students
Lookup functions
✓ LOOKUP syntax : LOOKUP(lookup_value, Array)
o It looks in the first row or column of an array
o Lookup_value can be text, number, logical value, a name or a reference
o Searches based on the array dimensions, Returns value from same position in last row/column
• If there are more columns than rows, it searches in the first row
• If equal number, or more rows, it searches first column

✓ LOOKUP syntax : LOOKUP(lookup_value, lookup_vector,result_vector)


o lookup_value can be text, number, logical value, a name or a reference
o lookup_vector is a range with only one row or one column
o result_vector is a range with only one row or one column
• lookup_vector and result_vector must be the same size
Note
✓ The LOOKUP function doesn't have an option for Exact Match. If the lookup value isn't found, it matches the largest value that is less than
the lookup value
✓ The lookup array or vector must be sorted in ascending order, or the result might be incorrect
✓ If the first value in the lookup array/vector is bigger than the lookup value, the result is an #N/A error

Restricted Access - This presentation is only for IIM Lucknow Students


Lookup functions
Important point to notes in LOOKOP
✓ If range_lookup is TRUE or omitted
o you must sort the values in the first column in ascending order
✓ If the first column of the table is text,
o You can use the standard wildcard characters in the lookup_value argument
• use ? to substitute for individual characters
• use * to substitute for multiple characters
✓ If lookup_value is less than any value in the lookup column,
o VLOOKUP() returns the #N/A error value
✓ If VLOOKUP() doesn’t find a match in the lookup column,
o it returns #N/A
✓ If col_index_num is less than 1,
o VLOOKUP() returns #VALUE!;
✓ If col_index_num is greater than the number of columns in table,
o VLOOKUP() returns #REF!
✓ When looking for exact match
o The fourth arguments is not optional, must be FALSE
o The first column of the lookup table doesn't have to be in ascending order;
o If no exact match exists, the function returns an error (#NA)

Restricted Access - This presentation is only for IIM Lucknow Students


INDEX function
✓ Allows you to return the entry in any row and column within an array of numbers.

The number of rows in reference from which to


return a value. Can omit if reference is single row.
If you enter more than one range for
reference, area_num is the range you
want to use.
✓ Syntax : INDEX(Reference, Row Number, Column Number, Area Number) First range you entered is 1, the second
is 2 and so on

A reference to one or more


cell ranges
The number of columns in reference from which to return a
value. Can omit if reference is single column.

✓ Syntax : INDEX(Array, Row Number, Column Number)

Note
✓ If you set the row number to “0”, the INDEX function references the listed column
✓ If you set the column number to “0”, the INDEX function references the listed row in the array

Restricted Access - This presentation is only for IIM Lucknow Students


MATCH function
✓ The MATCH function enables you to find within a given array the first occurrence of a match to a given text string or number.
✓ MATCH function instead of a lookup function in situations in which you want the position of a number in a range rather than the value in a
particular cell.
The range you’re examining for a match to the lookup value. The lookup
range must be a row or a column.

✓ Syntax : Match(lookup value, lookup range,[match type])

The value you’re trying to


match in the lookup range.
• Match type = 1 requires the lookup range to consist of numbers listed in ascending order.
• Match type = –1 requires the lookup range to consist of numbers listed in descending order.
• Match type = 0 returns the row location in the lookup range that contains the first exact match
to the lookup value.
Note
✓ When no exact match exists and match type=0, Excel returns #N/A
✓ Most MATCH function applications use match type=0, but if match type is not included, match type=1 is assumed
✓ Use Match type 0 when the cell contents of the lookup range is unsorted
✓ The MATCH function can also work with an inexact match by using like “abc*”
✓ The MATCH function can be used in combination with functions such as INDEX and VLOOKUP.
Restricted Access - This presentation is only for IIM Lucknow Students
Circular references
✓ A circular reference occurs when the value in a cell depends on the value in another cell that, in turn, is dependent on the value in the
original cell.

✓ Usually, a circular reference indicates a formula contains an error – and Excel displays a warning telling you so!
✓ Occasionally, a circular reference is needed to accomplish a particular task.
o Note also that Excel’s iteration procedure is guaranteed to work only when solving systems of linear equations
✓ Enabling Circular reference:
o Goto File → Options → Formulas
o Click on Enable Iterative Calculation

Restricted Access - This presentation is only for IIM Lucknow Students


Database statistical functions
✓ DSUM syntax : DSUM(database, field, criteria)
• Database is the cell range that makes up the database.
o The first row of the list contains labels for each column.
• Field is the column containing the values you want the function to add.
o You can define the field by enclosing the column label in quotation marks.
• Criteria refers to the cell ranges that specify the rows on which the function should operate.
o Multiple criteria in the same row are joined by AND, whereas criteria in different rows are joined by OR.

▪ Similar syntax for other Database functions too


✓ Formula → Fx → Select Category as “Database functions”
▪ DSUM, DAVERAGE, DCOUNT , DCOUNTA,
▪ DGET, DMAX, DMIN, DPRODUCT,
▪ DSTDEV, DSTDEVP, DVAR and DVARP

9
The OFFSET function
✓ The OFFSET function is used to create a reference to a range that is a specified number of rows and columns away from a cell
or range of cells
✓ Perform a lookup operation based on the right-most column in a table range instead of the left-most column
✓ I download the most recent month’s unit sales. I would like my chart to update automatically. Is there an easy way to accomplish this?
✓ OFFSET(reference, rows moved, columns moved, height, width)

(Both Optional) give the number of rows and


A cell or range of cells (adjacent to each columns in the offset range.
other) from which the offset begins

Key points to note


✓ Rows moved: A negative number of rows moves you up from the reference; a positive number of rows moves you down.
✓ Columns moved: A negative number of columns moves you left from the reference; a positive number of columns moves you right.
✓ Evaluate Formula feature work – F9 (Press Escape)
✓ Transpose(array) : To be used with CTRL+SHIFT+ENTER

Restricted Access - This presentation is only for IIM Lucknow Students


The INDIRECT function
✓ INDIRECT function returns the reference specified by a text string
o Any reference to a call within the INDIRECT portion of formula results in immediate evaluation of the cell
reference to equal the content of the cell
✓ INDIRECT(ref_text,x1)
o ref_text is a text string for a reference
o x1 if TRUE or omitted - Uses an A1 reference style
o x1 if FALSE - Uses the R1C1 style

Note - Application
✓ INDIRECT function to change cell references in formulas without changing the formulas themselves.

✓ SHEETS() : Tells how many sheets in the workbook. Reference can be selected specific sheets.
✓ SHEET() : Returns the current sheet. Value helps to point the sheet number of selected cell.

Restricted Access - This presentation is only for IIM Lucknow Students


Filtering data and removing duplicates
✓ Simple filtering (based on specific column or combination)

✓ Copying the filtered content to a new sheet

✓ Clearing the filter

✓ Filter based on
o Numbers (Grater than) - Top 10 (Can be Top 30 too), Above Average
o Date - This week, last week etc.,
o Text - Begin with etc.
o Color - Font, Cell color
✓ Remove duplicates

✓ Reapply filter

Restricted Access - This presentation is only for IIM Lucknow Students


ERROR Messages
Error What to Do?
####### Widen the column or ensure that dates and times are not negative (i.e., prior to January 1, 1900).

#DIV/0 The formula is trying to divide by 0-check that you have entered the correct cell reference or that you have not deleted data by mistake.

#N/A The formula is referring to a cell containing the NA function-check that you have entered the correct cell reference. If you are using a lookup
function, check that there is a match for the lookup value and that you have sorted the table correctly. If you are using an array formula,
make sure that any arguments have the same number of rows and columns as the range holding the array formula. If the formula is a
custom formula, it may not be available or you may have omitted an argument.

#NAME? Check your spelling-you may have spelled a function or defined name incorrectly or you may have forgotten to enclose text in double
quotation marks. Also check that you have not omitted the colon in a range reference or the single quotation marks around a sheet name.

#NULL! Make sure that you have entered references to cell ranges correctly-the formula may be referring to a nonexistent intersection between two
ranges. Also check that you are using the correct range operator and that you have not entered a space instead of a comma.

#NUM! Check that the arguments in the function are numbers or cells containing numbers. If you are using an iteration function like IRR or RATE,
Excel may not be able to find a result; you can try increasing the number of iterations in Excel Options. A #NUM! error will also appear if a
number is too large or too small for Excel to calculate.

#REF! Check the cell references-you may have deleted a cell or cut or copied the formula, rendering any references invalid. If you are using an OLE
link, make sure that the program is running or you may be linking to a DDE topic that is not available

#VALUE! Check that the arguments in the function are the correct data type, that you have used the correct operands, or that you have entered an
array formula properly

13
CELL function

Restricted Access - This presentation is only for IIM Lucknow Students


Absolute and Relative References In Microsoft Excel (Case 3)
Reference type Example Explanation

Relative reference =B2 The column and the row both change when copied

Absolute reference =$B$2 The column and the row both do not change when copied

Absolute column reference =$B2 The column does not change when copied; the row does change

Absolute row reference =B$2 The row does not change when copied; the column does change

Restricted Access - This presentation is only for IIM Lucknow Students


Additional Readings / References

❖ MS Excel 2019 Data Analysis and Business Modeling, by Wayne L Winston, Microsoft Press

o Chapter – 3, 4, 5, 11, 22, 23 and 51

❖ Absolute and Relative References In MS Excel (Kyle Maclean, Lauren E. Cipriano, Gregory S. Zaric)

W16406-PDF-ENG

Restricted Access - This presentation is only for IIM Lucknow Students


THANK YOU

Restricted Access - This presentation is only for IIM Lucknow Students

You might also like