CS103 12
CS103 12
Computer Science –
Business Problems
Instructor: Zhe He
Department of Computer Science
New Jersey Institute of Technology
10/30/2024 1
Creating Basic Formulas
A formula is a series of instructions that you
place in a cell in order to perform some kind
of calculation.
= 5+2*2^3–1
= 5 + 2 * 2 ^ (3 – 1)
Cell References
Calculate the sum of two cells
= A1 + A2
decimal places.
Add a title to Column E.
Excel calculates the result of a formula every
time you open a spreadsheet or change the
data a formula uses.
Exercise
Download StudentGrades1.xlsx
Colon(:)
separates the top-left and bottom-right corners of
a block of cells
e.g., A1:A5, A2:B3
Space ()
intersectionoperator
e.g., A1:A3 A1:B10
Cell Ranges (cont.)
A:A
includes all the cells in column A
2:2
includes all the cells in row 2
SUM()
You can combine different ways of range
selection.
multiple calculations?
e.g., currency conversion ratio
false.
MAX(range)
MIN(range)
LARGE(range, position)
SMALL(range, position)
e.g.,
LARGE(A2: A12, 2)
SMALL(A2: A12, 1)
Exercise
Modify StudentGrades2.xlsx
Add the following statistics at the bottom of
the table
Total
Average
Median
Highest Score
Second Highest Score
Third Highest Score
Lowest Score
ABS()
gives you the absolute value of a number.
= ABS (-3)
Use IF()?
ROUND()
rounds a numeric value to whatever level of
precision you choose.
ROUND(number_to_round,
number_of_digits)
= ROUND(3.987, 2)
= ROUND(A2, -2)
= RAND()
= RAND() * 100
cells.
= COUNTIF(C1:C20, “>500”)
= COUNTIF(D1:D20, “=Travel”)
= COUNTIF (D1:D20, “=” & A2)
VLOOKUP()
Finds a specific row in a large table by
Scanning the values in a single column from top to
bottom
Retrieving other information from the same row
Download VLookupExample.xlsx
What is the name and price of the product with ID
of 3?
VLOOKUP()
VLOOKUP(lookup_value, range,
column_index_number, FALSE)
lookup_value
column_index_number: position of the column
column_number)