Professional Documents
Culture Documents
MODULE 2 Introduction To Construction Estimates (Microsoft Excel Programming)
MODULE 2 Introduction To Construction Estimates (Microsoft Excel Programming)
Shift + F5 It provides users the option to display the find and replace dialog box.
Ctrl + B It allows you to bold all selected items of an Excel sheet. It can also be
done by pressing Ctrl + 2.
Ctrl + D It enables you to fill down the cells with the content of the selected cell.
As shown in the below picture:
Ctrl + F It offers the option to open find and replace dialog box quickly. You can
also use Shift + F5 for it.
Ctrl + G It is used to open the go-to option dialog box where you can go to the
specific cell. It can also be done by using F5.
Ctrl + H It allows you to find and replace the word or sentences in a file. For
example, if by mistake you have written a computer instead of the
computer at many places in your sheet, you can replace it with the
computer in one go.
Ctrl + I It is used to put italics on all cells in the selected section. It can also be
done by pressing Ctrl + 3.
Ctrl + O It offers users the option to open the dialog box where you can choose a
file that you want to open. You can also use Ctrl + F12 to open a file.
Ctrl + Q It is used to display the quick analysis options for the selected cells
with data. As shown in the below image:
Ctrl + R It allows you to fill the cells to the right with the content of the selected
cell. As shown in the below screenshot:
Ctrl + S Its use is to save the document. It can also be done by using
Alt + Shift + F2.
Ctrl + T It offers users the option to display the create table dialog box.
Ctrl + U It is used to underline all selected cells. You can also use the shortcut
key Ctrl + 4 to underline the cells in the Excel sheet.
Ctrl + V It provides users the option to paste the copied data onto the Excel sheet.
You are required to copy the data once, and then you can paste it any
number of times.
Ctrl + W It is used to close the currently open document or a file quickly. It can
also be done by pressing Ctrl + F4 shortcut keys.
Ctrl + X It allows users the option to cut the entire data of the selected cells in an
Excel sheet.
Ctrl + Z It is used to undo (get back) the deleted item. For example, if you have
deleted the data by mistake, you can press Ctrl + Z to retrieve the deleted
data. It can also be done by pressing Alt + Backspace.
Ctrl + F6 It enables the users to move from one document to another document
in Microsoft Excel. It can also be done by pressing Ctrl + Tab.
F4 It provides users the option to repeat the last action. For example, if you
change the red color of the text in a cell, by pressing F4, you can apply
the same text color in another cell.
F10 The function key F10 is used to activate the menu bar. For example, if
you want to open the file menu, you need to press F10, then F.
F12 It enables you to use the Save As option, which allows you to save a file
with a different name. It can also be done by using Alt + F2.
Alt + = It allows you to use the formula to add the data of all the above cells.
Ctrl + Shift + " It allows you to copy the content of a cell and to paste it into a cell, which
is just below it. It can also be done by using Ctrl + " key. For example, if
you have written "Excel" in cell B1 and its below cell is B2, by
pressing Ctrl + Shift + " or Ctrl + ' the word "Excel" will be copied in cell
B2.
Ctrl + Shift +! It is used to apply comma format in numbers. For example, as shown in
the below image:
Ctrl + Shift + $ Its use is to apply currency format to numbers. As shown in the below
screenshot:
Ctrl + Shift +% It provides users the option to apply percentage sign to numbers. For
example, see the below picture:
Ctrl + (Right arrow →) It allows the users to move the cursor to the next cell, which contains the
text.
Ctrl + 1 It is used to open the format cells dialog box where you can change the
text format like text color, font size, font style, text alignment, etc. It can
also be done by pressing Ctrl + Shift + F or Ctrl + Shift + P.
Ctrl + 5 Its use is to put the strikethrough to all selected cells. As shown in the
below picture:
Ctrl + - It will open a delete dialog box where you can delete a selected row or
column.
Ctrl + Shift + = It will open the insert dialog box where you can insert the new row or a
column.
Ctrl + Shift + ^ It is used to make an exponential form of any number. For example, you
have written a number 12345 in the worksheet, and if you press
Ctrl + shift + ^, the number will be changed 1.23E+04 in exponential
form.
Ctrl + Shift + & It offers users the option to make a border around the selected cells.
Ctrl + Shift + _ It offers users the option to remove a border around the selected cells in
a worksheet.
Ctrl + Home It allows the users to move the cursor to the beginning (cell A1) of the
worksheet.
Ctrl + End It is used to move the cursor to the last cell with text on the worksheet.
Shift + Page Up It allows you to select all the cells located above the selected cell.
Shift + Home It enables you to select all cells to the left of the current active cell.
Shift + (Up Arrow ↑) It enables you to extend the selected area up by one cell.
Shift + (Down Arrow ↑) It enables you to extend the selected area down by one cell.
Alt + Enter It allows the users to write in multiple lines in one cell. For example, if you
are typing in a cell, it enables you to move on the next line in one cell by
pressing Alt + Enter.
Alt + F11 It provides users the option to open the Visual Basic editor.
DISCLAIMER. The sample Excel spreadsheets in this module are to provide the reader with examples
of how Excel may be used in estimating, and as such, are designed for a limited number of estimating
situations. Before using the spreadsheets in this module, the reader should understand the limits of the
spreadsheet and carefully verify that the spreadsheets (1) are applicable to his or her estimating
situation and (2) produce an acceptable answer. The reader assumes all risks from the use and/or
performance of these spreadsheets.
Microsoft Excel has two basic ways to perform calculations: Formulas and Functions. Functions
and formulas are the bread and butter of Excel. They drive almost everything interesting and
useful you will ever do in a spreadsheet. This article introduces the basic concepts you need to
know to be proficient with formulas in Excel.
In this subject, we will use different functions and formulas to solve certain topics that are useful
in our field.
1. Formulas
In Microsoft Excel, a formula is an expression that works on values in a range of cell/s.
Example:
=A1+A2+A3+A4+A5, which finds the total sum of the selected range of values from cell
A1 to cell A5.
2. Functions
In Microsoft Excel, a function is a predefined formula to eliminate lengthy manual entry of
formulas.
For example:
=SUM(A1:A5). This results with the same answer from formula which gives the total
sum on the values from cell A1 to A5.
Note: Formula/Function always starts with equal sign (=). In function, it is followed by
the function’s name, open parenthesis, arguments, and close parenthesis. Any
information/input you give to a function is called an argument.
Example:
=SUM(A1:A5)
Function’s argument
name
WRITING FORMULAS
The formulas contain mathematical calculations. Formulas may consist of numbers, variables,
and operators. Numbers are typed in from the keyboard and do not change. Cells within the
worksheets that are referenced by the formula are known as variables. Variables are entered by
typing the cell reference or by selecting the cell and include in writing the formula.
MATHEMATICAL OPERATIONS
An Excel Formula/Function always start with an equal sign (=).
a. Addition, plus sign (+)
b. Subtraction, hyphen (‐) (also used for negative)
c. Multiplication, asterisk (*) or parenthesis (())
d. Division, slash or backslash (/)
e. Exponent/Power, caret (^)
LOGICAL OPERATIONS
a. Greater than (>)
b. Less than (<)
c. Equal to (=)
d. Greater than or equal (>=)
e. Less than or equal (<=)
f. Not equal to (<>)
When a formula contains relative referencing and it is copied from one cell to another, Excel
does not create an exact copy of the formula. It will change cell addresses relative to the row
and column they are moved to. For example, if a simple addition formula in cell C1 “=(A1+B1)”
is copied to cell C2, the formula would change to “=(A2+B2)” to reflect the new row (see figure
below).
To prevent this from happening, cells must be called by absolute referencing. This is
accomplished by placing dollar signs “$” within the cell addresses in the formula. Continuing
the previous example, if the formula in cell C1 reads “=($A$1+$B$1)” and this is to be copied to
cell C2, it will have the same result as C1. Both the column and row of both cells are absolute
and will not change when copied (see figure below).
Mixed referencing can also be used where the row or column is fixed, but not both. For
example, in the formula “=(A$1+$B2)”, the row of cell A1 is fixed but not the column and the
column of cell B2 is fixed but not the row (see figure below).
BASIC FUNCTIONS
In addition to mathematical equations, computer functions can also be included in the formulas.
Functions are entered by the following options.
Option 2: Popup menu of Lookup & Reference Function from Formulas Tab
From the Insert Function Dialogue box, the user may make a function available for selection
by (option 1) selecting All or (option 2) the function’s category from the Or select a category:
dropdown box (Financial, Date & Time, Math & Trig, Statistical, Lookup & Reference, Database,
Text, Logical, Information, Engineering, Cube, Compatibility, and Web). Alternatively, (option 3)
the user may perform a key word search by typing key words in the Search for a function: text
box and clicking on the Go button.
When the function is shown in the Select a function: list box, the user may either double clicks
on the function or selects the function and clicks on the OK button to bring up the Function
Arguments dialogue box. The Function Arguments dialogue box for the SUM function is shown
in the figure below. Each function has its own Function Arguments dialogue box. The Function
By: Engr. Rizza P. Gamalinda P a g e 8 | 37
CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Arguments dialogue box prompts the user for the information necessary to complete the
function. The user enters the requested information and clicks the OK button to close the
Function Arguments dialogue box and create the function.
▪ SUM
The SUM function adds a group of numbers and is particularly useful when adding a column,
row, or block number. When used, only the cells containing the first and last number are
needed to be included in the formula.
Noncontiguous cells may be added by placing a comma between the cells references. The
formula =SUM(A1:A5,B1) adds the numbers in Cells A1, A2, A3, A4, A5, and B1. The SUM
function is quickly inserted into a cell by clicking on the Formula menu tab and clicking on the
AutoSum button in the Function Library group in Formulas Tab.
▪ AVERAGE
The AVERAGE function is configured to solve for the average of the values in a range of cells.
Only the cells containing numbers are included in the average.
▪ MAXIMUM
The MAXIMUM function returns the highest number in a range of cells.
Example: =MAX(A1:A100) → Finds the highest value from cells A1 through A100
Example: =MIN(A1:A100) → Finds the lowest value from cells A1 through A100
▪ ROUNDING
Excel provides the user 3 standard rounding functions: (1) ROUND, which rounds to the closest
number; (2) ROUNDDOWN, which rounds the number down; and (3) ROUNDUP, which rounds
the number up. Each of these functions requires the user to indicate the number or cell
containing the number to be rounded (Number) and the number of digits to round to
(Num_digits).
Examples:
=ROUND(143.145,2) → The number of digits in the function is equals to 2, the
function will round the decimal places to hundredths. This example will result to
143.15.
▪ CEILING
The CEILING function may be used to round up a number to the next multiple of a specified
number (referred to by Excel as significance). For example, if the significance is 0.50, the
CEILING function will round up to the next 0.50 increment. The CEILING function requires the
user to indicate the number or cell containing the number to be rounded (Number) and the
significance.
FORMULA: =CEILING(NUMBER,SIGNIFICANCE)
▪ FLOOR
The FLOOR function works in the same way as the CEILING function except it rounds down.
FORMULA: =FLOOR(NUMBER,SIGNIFICANCE)
▪ TRIM
The TRIM function allows the users to remove unnecessary extra trailing and leading spaces
from the cell.
FORMULA: =TRIM(CELL)
Example:
▪ PROPER
The PROPER function is a text function that allows the users to make each of the entered text
into a proper-looking style or sentence cases into capitalizing the 1st letter of each word.
FORMULA: =PROPER(CELL)
Example:
▪ NOW
The NOW function will just tell the user precisely what time and day it is.
FORMULA: =NOW()
▪ TRANSPOSE
The TRANSPOSE function returns a vertical range of cells when a horizontal range is entered
as an input and vice versa.
FORMULA: =TRANSPOSE(ARRAY)
Example:
An IF statement can have two results. The 1st result is if the comparison is True, the 2nd if the
comparison is False.
=IF(A2=1,“Goodmorning”,“Goodevening”)
says IF(A2 = 1, then return a word
“Goodmorning”, otherwise return a word
“Goodevening”).
Using a function as one of the arguments in a formula that uses a function is called
NESTING, and we’ll refer to that function as a NESTED FUNCTION.
You are not limited to only checking if one thing is equal to another and returning a
single result, you can also use mathematical operators (as discussed on previous
topics in the beginning of this module) and perform additional calculations depending
on your criteria. You can also nest multiple IF functions together in order to perform
multiple comparisons (see example below).
=IF(A2<=3,"Goodmorning",IF(A2<=7,"Goodafternoon","Goodevening"))
Logical Value if Logical test Value if true Value if false
test true Value if false: another IF Function
Nested function: Inside Nested function: Inside Nested function: Nested function:
Opening parenthesis Opening parenthesis Closing parenthesis Closing parenthesis
=IF(A2<=3,"Goodmorning",IF(A2<=7,"Goodafternoon","Goodevening"))
says =IF(A2 is less than or equal to 3, return a word "Goodmorning",IF(A2 is less
than or equal to 7 (but greater than 3 because this was already included in the 1st
argument, in other words, it ranges from 4 to 7), return a word "Goodafternoon",
otherwise return a word "Goodevening"(all numerical values greater than 7, meaning
from 8 onwards will be returned with a result of “Goodevening”) ))
NOTE:
Any text criteria or any criteria that includes logical or mathematical symbols must
be enclosed in double quotation marks (“”). If the criterion is numerical value, double
quotation marks are not required.
By: Engr. Rizza P. Gamalinda P a g e 12 | 37
CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
ADDITIONAL TOPIC:
You can open the Excel HELP Pane by (option 1) clicking on F1 key as the standard key to
get help in MS Office, (option 2) clicking the HELP Tab on your ribbon (see figure below). In
Excel 2016, (option 3) you use can the query box or search box to enter your question and
select from helpful option links or select the question mark from the dropdown list to launch
Excel Help Pane.
For example, the user has trouble on understanding how to use the TRANSPOSE Function.
By option 2, the Help Pane will appear on the right side of your computer. Type on the Search
bar the function you want to know. The image below is showing us the result.
▪ VLOOKUP
VLOOKUP function helps to search for a certain criterion against a choosen column. It
searches for the given condition/s and returns a matching value from another column.
In order to solve this problem using Volume Method, the 1st step is to compute its volume. Using
this volume as your constant multiplier, one must use the respective reference table to get the
appropriate factors given the criteria (Class Mixture, Cement, Sand and Gravel) from Table 1-2. See
how the formula VLOOKUP help us know what this value is without manually inputting the said
factor in the cell.
Formula
Criteria Factors
criteria
criteria
The idea here is to solve the problem by only filling up the cell with
our criteria (Class Mixture, mass of cement, sand, gravel) and let
the Excel search from the values in the reference table by
specifying the particular number of column where to get the factor.
=VLOOKUP(V9,$B$3:$F$7,2,0)
Lookup value array Accuracy
or criteria Column Number
=VLOOKUP(V9,$B$3:$F$7,3,0)
Lookup value array Accuracy
or criteria Column Number
=VLOOKUP(V9,$B$3:$F$7,4,0)
Lookup value array Accuracy
or criteria Column Number
=VLOOKUP(V9,$B$3:$F$7,5,0)
Lookup value array Accuracy
or criteria Column Number
a. Lookup value or criteria: V9 refers to the criterion of the problem (class mixture) in which other
choices must also list down in a column format. The row where V9 is located will be a constant
row that will give the corresponding values based on the number of column that will be specified
in the VLOOKUP Formula.
b. Array: $B$3:$F$7 refers to the cells which contain the values that satisfy your criteria. In our
example, see how the class mixture are listed in a column.
c. Column Number: 2, 3, 4, 5 (40 kg per bag of cement, 50 kg per bag of cement, sand, and gravel
respectively) refers to that particular column where the lookup value will be matched with to give
the correct value.
d. Accuracy: “0” refers to the accuracy of finding the corresponding value for your VLOOKUP
formula.
Notes:
▪ VLOOKUP Function works when the set of choices for the lookup value or criteria are listed
in a single column and match against with values in multiple columns of the same row where
that lookup value is located.
▪ HLOOKUP
HLOOKUP function helps to search for a certain criterion against a chosen row. It searches for
the given condition/s and returns a matching value from another row.
Formula
Criteria Factors
criteria
criteria
The idea here is to solve the problem by only filling up the cell with
our criteria (Class Mixture, mass of cement, sand, gravel) and let
the Excel search from the values in the reference table by
specifying the particular number of row where to get the factor.
=HLOOKUP(S10,$B$3:$F$7,5,0)
Lookup value array Accuracy
or criteria Row Number
=HLOOKUP(S11,$B$3:$F$7,5,0)
Lookup value array Accuracy
or criteria Row Number
=HLOOKUP(S12,$B$3:$F$7,5,0)
Lookup value array Accuracy
or criteria Row Number
=HLOOKUP(S13,$B$3:$F$7,5,0)
Lookup value array Accuracy
or criteria Row Number
a. Lookup value or criteria: S10, S11, S12, S13 refers to the criteria of the problem (40 kg per
bag of cement, 50 kg per bag of cement, sand, and gravel respectively) in which these criteria
must be list down in a single row format.
b. Array: $B$3:$F$7 refers to the cells which contain the values that satisfy your criteria.
c. Row Number: “5” (class mixture) refers to that particular row where the lookup values S10, S11,
S12, S13 will be matched with to give the correct value.
d. Accuracy: “0” refers to the accuracy of finding the corresponding value for your VLOOKUP
formula.
Notes:
▪ HLOOKUP Function works when the set of choices for the lookup value or criteria are listed
in a single row and match against with values in multiple rows of the same column where
that lookup value is located.
Step 2: Configure
Settings. Choose from the
options what to allow for
the validation of criteria. In
our example, the
appropriate validation is
“List”. After clicking List,
we have to select the
Source: by selecting the
cells that contain these
choices.
Step 5: Now, after configuring on Input Message and the Error Alert to display a respective
dialogue box, the following figures below show you the result.
Step 6: Lastly, try to enter a different alphabet/punctuation/number not listed on 4 Class Mixtures or
the cells set to Source: in Step 2. The image below is showing us the result.
▪ INDEX MATCH
Formula: =INDEX(array,MATCH(cell,column,accuracy),MATCH(cell,row,accuracy))
This is an advanced alternative to the HLOOKUP and VLOOKUP formulas that have quite a few
limitations or drawbacks. INDEX MATCH is a powerful combination of Excel formulas as gives the
value straightforward given that the criteria is clear.
INDEX refers the value of a specific cell in a table based on its row and column number while MATCH
refers the position of a specific cell in a row or column.
Here are 2 examples of the INDEX and MATCH formulas combined together as an alternative to
VLOOKUP and HLOOKUP from previous examples. In these examples, given the parameters/criteria,
we look up the factor within the table and use it to solve these problems.
In order to solve this problem using Volume Method, the 1st step is to compute its volume.
Using this volume as your constant multiplier, one must use the respective reference table to get the
appropriate factors given the criteria (Class Mixture, Cement, Sand and Gravel) from Table 1-2. See
how the formula INDEX MATCH help us know what these values are without manually inputting the
said factors in the cell.
Criteria Factors
criteria
criteria
Formula
:
Formula: =INDEX(array,MATCH(cell,column,accuracy),MATCH(cell,row,accuracy))
=INDEX($B$3:$F$7,MATCH($V$9,$B$3:$B$7,0),MATCH(S10,$B$3:$F$3,0))
=INDEX($B$3:$F$7,MATCH($V$9,$B$3:$B$7,0),MATCH(S11,$B$3:$F$3,0))
=INDEX($B$3:$F$7,MATCH($V$9,$B$3:$B$7,0),MATCH(S12,$B$3:$F$3,0))
=INDEX($B$3:$F$7,MATCH($V$9,$B$3:$B$7,0),MATCH(S13,$B$3:$F$3,0))
a. Array: $B$3:$F$7 refers to the range of data that starts from the 1st column and 1st row which
corresponds to the criteria of the INDEX MATCH formula.
b. Data for column criteria: $V$9 refers to the cell that contains the criteria whose choices are in
column format. In our example, see how the class mixture are listed in a column. $B$3:$B$7
refers to the range of data where the choices for $V$9 is found. “0” refers to the accuracy of
finding the corresponding value for your INDEX MATCH formula. In INDEX MATCH formula,
you have 3 choices of accuracy for the value namely “0 – exact”, “1 – less
than”, and “-1 – greater than” (see picture above).
c. Data for row criteria: S10, S11, S12, S13 refers to the cell that contains the criteria whose
choices are in row format. In our example, see how the parameters (cement, sand, gravel) are
listed in a row. Putting $ is a choice in Excel, but if the formula will be used repetitively in multiple
cells and the reference data is the same, it is advisable to put $ to denote this common similarity.
Know that if you are dragging the formula, there are instances the cells will also be adjusted.
$B$3:$F$3 refers to the range of data where the choices for S10, S11, S12, S13 are found. “0”
refers to the accuracy of finding the corresponding value for your INDEX MATCH formula. In
INDEX MATCH formula, you have 3 choices of match value or accuracy for the value namely “0
– exact”, “1 – less than”, and “-1 – greater than” (see picture above).
In order to solve this problem using Area Method, the 1st step is to compute its area. Using this
area as your constant multiplier, one must use the respective reference table to get the appropriate
factors given the criteria (Class Mixture, Cement, and Sand) from Table 2-2. See how the formula
INDEX MATCH help us know what these values are without manually inputting the said factors in the
cell.
Formula
:
Formula
:
Criteria Factors
criteria
criteria
The idea here is to solve the problem by only filling up the cell
with our criteria and let the Excel search from the values in
the reference table and give us the correct factor.
Formula: =INDEX(array,MATCH(cell,column,accuracy),MATCH(cell,row,accuracy))
=INDEX($B$4:$G$7,MATCH($R$10,$B$4:$B$7,0),MATCH($T$9,$B$4:$G$4,0))
=INDEX($B$4:$G$7,MATCH($R$10,$B$4:$B$7,0),MATCH($Q$12,$B$4:$G$4,0))
a. Array: $B$4:$G$7 refers to the range of data that starts from the 1st column and 1st row which
corresponds to the criteria of the INDEX MATCH formula.
b. Data for column criteria: $R$10 refers to the cell that contains the criteria whose choices are
in column format. In our example, see how the size of CHB are listed in a column. $B$4:$B$7
refers to the range of data where the choices for $R$10 is found. “0” refers to the accuracy of
By: Engr. Rizza P. Gamalinda P a g e 23 | 37
CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
finding the corresponding value for your INDEX MATCH formula. In INDEX MATCH formula,
you have 3 choices of accuracy for the value namely “0 – exact”, “1 – less
than”, and “-1 – greater than” (see picture above).
c. Data for row criteria: $T$9 and $Q$12 refers to the cells that contains the criteria (class mixture
for cement and sand) whose choices are in row format. In our example, see how the parameters
(cement and sand) are listed in a row. Also, in solving the example problem, we are looking for
only 2 factors among the values in the table. Therefore, with this reasoning, we can use $ to
simply denote that the reference cell will not change for the 2 selected cells where criteria (class
mixture, size of CHB and sand) will be entered. $B$4:$G$4 refers to the range of data where
the choices for $T$9 and $Q$12 are found. “0” refers to the accuracy of finding the corresponding
value for your INDEX MATCH formula. In INDEX MATCH formula, you have 3 choices of
accuracy for the value namely “0 – exact”, “1 – less than”, and “-1 – greater than” (see picture
above).
Notes:
▪ The formula always starts with an equal sign (=), followed by the code for a formula and
ends with appropriate sequence of closing parenthesis.
▪ A dollar sign ($) in Microsoft Excel is used to create absolute cell referencing. This tells
Excel that you want to always refer to a specific cell even when your formula is copied across
and one that will not change.
▪ A comma (,) separates each argument.
▪ Take note that the column/row selection for MATCH should start from the 1 st cell selected
in your array or range and is directly followed by values where you will get your choice.
In Excel, you can combine IF with AND Functions, or IF with OR Functions to create
multiple conditional situations.
Formula
:
Notes:
▪ The IF OR Function is configured to assess the cell where to input data if it matches the
data of any of the specified cell/numerical values/words on the logical part of the IF OR
Function to return a declared true value, otherwise, all other values aside from the
logical will be equivalent to the false value.
Formula
:
Formula
:
We are not limited only to use single function. With the use of nesting functions, we
can manipulate and combine the principle of IF AND and IF OR functions into a nested
function.
For example (see figure below), the available mass of cement that are being
manufactured today is either 40 kg or 50 kg per bag. Therefore, we can restrict the
user to only choose between these 2 masses. Likewise, the available Class Mixture
with data on Table 1-2 are AA, A, B and C. By that, we can only make few combinations
of mass and class mixture.
"The Table 1-2 does not have data for this class mixture.")
Value if false
Nested function, IF:
Closing parenthesis
b. Value if true: The function will return “We can solve this.” if both of the logical
tests/arguments are met.
c. Value if false: The function will return “The Table 1-2 does not have data for this class
mixture.” if one of the logical tests/arguments is not met.
The following figures below are the results when input data on either L9 and N9 is not
included on the specified logical arguments.
Just like the concept of INDEX MATCH Formula, the CHOOSE function will return a value from an
array corresponding to the reference cell provided. The function will return the nth entry(choice) in a
given list.
The CHOOSE function is very useful when creating scenarios in financial models. By using the
CHOOSE formula, the user is able to select between different scenarios that can flow through the
entire solution.
Formula Choices
:
Choice #1
Choice #2
Reference Cell Choice #3
Choice #4
Formula
:
=CHOOSE(N9,B4,B5,B6,B7)
Arguments/choices
Reference Cell
a. Reference cell: N9 refers to the cell that specifies which argument (choice) is selected from the
list of choices B4,B5,B6,B7.
b. Choices: B4,B5,B6,B7 should be written right after the reference cell. It is a list of one or more
values that we want to return a value from. The returning value will appear to a selected cell in
the worksheet. From the example, the equivalent of choice #4 is class mixture “C” which appear
in cell M11 as the selected returning cell.
Notes:
▪ If reference cell is 1, CHOOSE returns choice #1; if it is 2, CHOOSE returns choice #2; and
so on.
i. SUMIF adds all cells that meet certain criteria and gives you the numerical sum. SUMIF can only
be applied to 1 criterion and 1 range (1 Condition).
The Excel SUMIF’s criteria can be applied to dates, numbers, and text. The SUMIF function
supports logical operators (>,<,<>,=, or combination) and wildcards (*,?) for partial matching.
Example: The cost of 10x20x40 CHB, 15x20x40 CHB and 20x20x40 is 10php, 15 php and 18 php,
respectively. As per the supplier, if the cost of CHB per location is less than or equal to 2000 Php, the
supply will be delivered immediately and will be paid on cash by the owner. Otherwise, other supplies
Using the Area Method, we know that to solve for the number of CHB per location, we must
multiply the area and 12.5 pcs/sqm. From this, we will get the results under column M.
Formula Array
:
Criteria
Formula Array
:
Criteria
Manually, we can get the sum of the costs 1500php, 375 php, 750 php, 562.50 php, and
1687.5 php whose values are less than 2000 php by simply adding the values. This sum corresponds
to 4875 php as the cost of 1st batch of materials. Likewise, 11250php and 56225php sums to
16875php for the cost of 2nd batch of materials.
Since we have 2 independent conditions to satisfy: expense for materials that cost less than or
equal to 2000.00php and expense for materials that cost greater than or equal to 2000php, and our
aim is to know these numerical sums of the total expense for these conditions, Excel’s SUMIF
Function is a great help to lessen the burden of lengthy solution.
Formula: =SUMIF(array,“criteria″)
=SUMIF(N3:N9, “<=2000”)
array condition
=SUMIF(N3:N9, “>=2000”)
array condition
a. Array: N3:N9 refers to the range of data that you want to apply the criteria/condition against.
b. Criteria: “<=2000” and “>=2000” refers to the condition used to determine which cells to add.
Notes:
▪ The argument is enclosed by quotation marks (“”).
▪ The SUMIF function returns the sum of cells in a range that meet a single condition.
ii. While SUMIF gives numerical value, COUNTIF counts all cells that meet certain criteria and gives
you population. Just like SUMIF, COUNTIF can only be applied to 1 criteria and 1 range (1
Condition).
The Excel COUNTIF’s criteria can be applied to dates, numbers, and text. The COUNTIF function
supports logical operators (>,<,<>,=, or combination) and wildcards (*,?) for partial matching.
Example: (COUNTIF FOR NUMERALS) From the previous example, count the number of items
for 1st and 2nd batch of materials.
Formula Array
:
1
2
3
4
5
Criteria
Formula Array
:
Criteria
Formula: =COUNTIF(array,“criteria″)
=COUNTIF(N3:N9, “<=2000”)
array condition
=COUNTIF(N3:N9, “>=2000”)
array condition
a. Array: N3:N9 refers to the range of data that you want to apply the criteria/condition against.
b. Criteria: “<=2000” and “>=2000” refers to the condition used to determine which cells to
count.
Notes:
▪ The argument is enclosed by quotation marks (“”).
▪ The COUNTIF function returns the number of cells in a range that meet a single condition.
▪ N15 is the selected cell where the result based on the formula will appear.
Example: (COUNTIF FOR TEXT) Find the number of locations that uses 10 x 20 x 40 CHB and 15 x
20 x 40 CHB.
Formula Array
:
1
2
3
4
5
Criteria
Formula Array
:
Criteria
Formula: =COUNTIF(array,“criteria″)
Notes:
▪ The argument is enclosed by quotation marks (“”) since its is a text parameter.
By: Engr. Rizza P. Gamalinda P a g e 33 | 37
CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
▪ The COUNTIF function returns the number of cells in a range that meet a single condition.
▪ N18 is the selected cell where the result based on the formula will appear.
iii. The SUMIFS function sums cells in a range using supplied criteria. Unlike the SUMIF function,
SUMIFS can apply more than one set of criteria, with more than one range.
Example: How many 10 x 20 x 40 CHB and 15 x 20 x 40 CHB are required to order for the masonry
walls (interior and exterior parts) of the house?
Criteria
Criteria
From the example, the conditions are to know the quantity to be ordered for 10x20x40 CHB and
15x20x40 CHB. In order to know these 2 independent quantities, we should separate the needed
quantity per location based on their required CHB size.
Manually, the quantity for 10x20x40 CHB is simple the sum of 150pcs + 37.5pcs + 562.5pcs +
75pcs +56.25pcs which is equals to 881.25pcs. Likewise, for 15x20x0 CHB, that is 750pcs +
112.5 pcs = 862.5 pcs.
Having 2 parameters, the range of quantities versus the sizes of the material, we can eliminate
this manual solution by the use of SUMIFS Function. SUMIFS Function is configured to sum up
By: Engr. Rizza P. Gamalinda P a g e 34 | 37
CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
values that satisfy 2 or more conditions.
a. Array: M3:M9 refers to the range of data that you want to apply the criteria/condition against.
b. Criteria Range: K3:K9 refers to the range of data that come in pair with the criteria “10 x 20 x
40” and “15 x 20 x 40” which corresponding value refers to the data in array M3:M9.
c. Criteria: “10 x 20 x 40” and “15 x 20 x 40” refers to the condition used to determine which
cells to add from array M3:M9.
Notes:
▪ The criteria is enclosed by quotation marks (“”).
▪ The SUMIFS function returns the number of cells in a range that meet two or more
conditions. In the 1st picture above, SUMIFS is configured to sum values in column M when
the CHB size in column K is “10 x 20 x 40” and the numerical result will appear at the
selected cell N11. Likewise in the second example, SUMIFS is set to sum values in column
M when the CHB size in column K is “15 x 20 x 40” and the numerical result will appear at
the selected cell N12.
▪ N11, N12 are the selected cell where the result based on the formula will appear.
iv. The Excel COUNTIFS function returns the count of cells or the number of times that meet/match
two or more criteria. Just like SUMIFS, COUNTIFS can be used with criteria based on dates,
numbers, text, and other conditions. COUNTIFS supports logical operators (>,<,<>,=) and wildcards
(*,?) for partial matching.
Example: The owner wants to have an inventory for the doors and windows of his 2-storey
residential building. Help him count how many pairs of received & installed or pending & not yet
installed for windows and doors as shown from the picture using MS Excel.
Manually, we can count them and have the same following answers as listed on the summary of
the figure. But with the help of Excel’s COUNTIF, we can easily eliminate the burden of manual
counting especially for the cases wherein the data is vast, and the possibility of error is high.
=COUNTIFS(C3:C20,“Received”,D3:D20,“Installed”)
array criteria array criteria
=COUNTIFS(F3:F20,“Received”,G3:G20,“Installed”)
array criteria array criteria
a. Array: C3:C20 refers to the range of data that you want to apply the 1ST criterion/condition paired
with the 2nd criterion/condition on D3:D20 for Windows. If both criteria are met, they will be
counted. Likewise, this is also the same principle for F3:F20 paired with G3:G20 for Doors.
b. Criteria: “Received” paired with “Installed” and “Pending” paired with “Not yet installed” are the
criteria that should be met with the data on both chosen arrays C3:C20 & D3:D20 and F3:F20
& G3:G20 for windows and doors, respectively. And since COUNTIFS function only counts cells
that satisfy the criteria on the argument, they will not be counted if one of the partners of a
pair are not exactly met.
Notes:
▪ The criterion is enclosed by quotation marks (“”).
▪ The COUNTIFS function returns the count of cells in a range that meet two or more
conditions. In the picture above for windows, COUNTIFS is configured to count values in
column C when paired with column D, having either “Received” & “Installed” or “Pending” &
“Not yet installed”. This is also the same principle how the results are for the doors.
▪ F22, F23, F24, F25 are the selected cell where the result based on the formula will appear.