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

CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

MODULE 2: Introduction to Construction Estimates


(Microsoft Excel Programming)

▪ WHAT IS MICROSOFT EXCEL PROGRAMMING?


Programming is the process of writing instructions that get executed by computers. These
instructions are written in a programming language in which the computer can comprehend and
use to perform a certain task or even solve a problem.

▪ SOME MICROSOFT EXCEL SHORTCUT KEYS


Working with Microsoft Excel may take couple of times. To speed up your work and make it more
convenient, you can use the number of keyboard shortcut list down below.

SHORTCUT KEYS DESCRIPTION

Ctrl + Shift +; It is used to insert the current time.

Ctrl +; It is used to enter the current date.

Shift + F3 Its use is to open the Excel formula's window.'

Shift + F5 It provides users the option to display the find and replace dialog box.

Ctrl + A Its use is to select or highlight all contents of a worksheet.

Ctrl + B It allows you to bold all selected items of an Excel sheet. It can also be
done by pressing Ctrl + 2.

Ctrl + C It is used to copy the selected content of a worksheet.

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.

By: Engr. Rizza P. Gamalinda P a g e 1 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Ctrl + K It provides the option to insert a hyperlink in a file.

Ctrl + L It enables you to access the create table dialog box.

Ctrl + N Its use is to open the new document or a workbook.

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 + P It allows you to print a current sheet or a document quickly.

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 + Y It provides users the option to redo any undo contents.

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.

By: Engr. Rizza P. Gamalinda P a g e 2 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Ctrl + Page up & Page It allows you to move from one worksheet to another worksheet in the
Down same Excel file.

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.

Ctrl + F9 It enables users the option to minimize the current window.

Ctrl + F10 It uses to maximize the currently selected window.

F1 It is used to open the help screen window.

F2 It allows you to edit the selected cell in the Excel sheet.

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.

F7 It is used to check the spelling of the selected text.

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.

F11 Its use is to create a chart in Excel.

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:

By: Engr. Rizza P. Gamalinda P a g e 3 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Ctrl + Space It enables you to select the entire active columns.

Shift + Space It enables you to select the entire active rows.

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 + 9 Its use is to hide the selected rows in the worksheet.

Ctrl + Shift + ( Its use is to show (unhide) the hidden rows.

Ctrl + 0 It is used to hide the selected columns.

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 + Shift + Spacebar It is used to select the entire 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.

By: Engr. Rizza P. Gamalinda P a g e 4 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Alt + ' It is used to access the style dialog box.

Ctrl + F3 It is used to open the name manager in Microsoft excel.

Ctrl + F5 Its use is to restore the Window size.

Ctrl + F11 It is used to insert a macro sheet in Microsoft excel.

Alt + F8 It is used to display the macro dialog box.

Alt + F11 It provides users the option to open the Visual Basic editor.

Alt + Shift + F1 It enables you to create a new worksheet in Microsoft Excel.


Source: https://www.javatpoint.com/computer-shortcut-keys#Basic

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.

By: Engr. Rizza P. Gamalinda P a g e 5 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
EXCEL FUNCTIONS AND FORMULAS

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 (<>)

By: Engr. Rizza P. Gamalinda P a g e 6 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
ORDER OF OPERATIONS
Excel performs the calculation of a formula in the following order:
1. The calculations enclosed by the parentheses are performed, starting with the
innermost pair, and working out to the outermost pair of parentheses.
2. The variable or number raised to a power is performed.
3. Multiplication and division are performed.
4. addition and subtraction are performed.
When two calculations have the same priority, they are performed left to right.

EDITING FORMULAS AND FUNCTIONS


Existing formulas are edited by selecting and clicking on the cell and editing the
formula/function in the Formula bar.

RELATIVE, ABSOLUTE, AND MIXED REFERENCING


Relative referencing is the practice of calling cells by just their column and row labels (example:
A1).

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 1: Typing the functions in the Formula Bar


option 2: Selecting the Formulas Menu Tab from the Formula Tab in the ribbon, selecting
the function category from the Function Library Group, and selecting the function from the
popup menu

By: Engr. Rizza P. Gamalinda P a g e 7 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
option 3: By clicking on the Insert Function button on the formula bar to bring up the Insert
Function Dialogue box and typing the function to be used in

Choose from the


Choose the
Function Library
function from the
Popup Menu

Option 2: Popup menu of Lookup & Reference Function from Formulas Tab

Click this to popup Type the name of


Insert Function the Function here
Dialogue Box
You can also
choose from here

Option 3: Insert Function Dialogue Box

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.

Example of Function Argument Dialogue Box for SUM 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.

FORMULA: =SUM(BEGINNING CELL:ENDING CELL)

Example: =SUM(A1:A100) → Finds the sum of cells A1 through A100

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.

FORMULA: =AVERAGE(BEGINNING CELL:ENDING CELL)

Example: =AVERAGE(A1:A100) → Finds the average of cells A1 through A100

▪ MAXIMUM
The MAXIMUM function returns the highest number in a range of cells.

FORMULA: =MAX(BEGINNING CELL:ENDING CELL)

Example: =MAX(A1:A100) → Finds the highest value from cells A1 through A100

By: Engr. Rizza P. Gamalinda P a g e 9 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
▪ MINIMUM
The MINIMUM function returns the lowest number in a range of cells.

FORMULA: =MIN(BEGINNING CELL:ENDING CELL)

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).

FORMULA: =ROUND(NUMBER,NUM_ DIGITS) or =ROUND(CELL,NUM_DIGITS)


FORMULA: =ROUNDDOWN(NUMBER,NUM_ DIGITS) or
=ROUNDDOWN(CELL,NUM_DIGITS)
FORMULA: =ROUNDUP(NUMBER,NUM_ DIGITS) or
=ROUNDUP(CELL,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.

=ROUNDDOWN(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.14.

=ROUNDUP(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)

Example: =CEILING(143.145,0.50) → The specified significance is 0.50. This will result


to 143.50.

▪ FLOOR
The FLOOR function works in the same way as the CEILING function except it rounds down.

FORMULA: =FLOOR(NUMBER,SIGNIFICANCE)

Example: =FLOOR(143.145,0.50) → The specified significance is 0.50. This will result


to 143.00.

By: Engr. Rizza P. Gamalinda P a g e 10 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
▪ CONCATENATE
The CONCATENATE function allows the users to join 2 or more strings/content of cells
together.

FORMULA: =CONCATENATE(CELL # 1,”space“,CELL# 2,”space“,CELL # 3,”…….)


Example:

▪ 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()

Example: → Select which cell you would like


to appear the time and day

▪ 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:

By: Engr. Rizza P. Gamalinda P a g e 11 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
▪ IF
The IF function is one of the most popular functions in Excel as it allows the user to make logical
comparisons between a value and what he expects.

An IF statement can have two results. The 1st result is if the comparison is True, the 2nd if the
comparison is False.

FORMULA: =IF(LOGICAL TEST,VALUE IF TRUE,VALUE IF FALSE)


Example:

The IF function can be used to evaluate both text and values.

=IF(A2=“Yes”,1,2) says IF(A2 = Yes, then return


number 1, otherwise return number 2).

=IF(A2=1,“Goodmorning”,“Goodevening”)
says IF(A2 = 1, then return a word
“Goodmorning”, otherwise return a word
“Goodevening”).

USE NESTED FUNCTIONS IN A FORMULA

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:

▪ USING HELP TAB IN EXCEL


The HELP TAB provides the users extensive information about the Excel application.
Although some of this information may be stored on your computer, the Help pane will
automatically connect to the Internet, whenever there is access, to provide you with resources
that can answer most of your questions.

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.

Figure: Example of popping up of Help Pane by option 2.

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.

By: Engr. Rizza P. Gamalinda P a g e 13 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
OTHER FUNCTIONS

▪ 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.

FORMULA: =VLOOKUP(LOOKUP VALUE,ARRAY,COLUMN NUMBER,ACCURACY)

Example: Concrete Proportion for Concrete Slab using Volume Method

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.

By: Engr. Rizza P. Gamalinda P a g e 14 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Let’s investigate how the formula works!

Formula: =VLOOKUP(LOOKUP VALUE,ARRAY,COLUMN NUMBER,ACCURACY)

=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: =HLOOKUP(LOOKUP VALUE,ARRAY,ROW NUMBER,ACCURACY)

By: Engr. Rizza P. Gamalinda P a g e 15 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Example: Concrete Proportion for Concrete Slab using Volume Method (same ex. As VLOOKUP)

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.

Let’s investigate how the formula works!

Formula: =HLOOKUP(LOOKUP VALUE,ARRAY,ROW NUMBER,ACCURACY)

=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.

By: Engr. Rizza P. Gamalinda P a g e 16 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
ADDITIONAL TOPIC:

▪ DATA VALIDATION or INPUT RESTRICTION


Data validation is one of the most powerful excel capabilities. It helps to make sure that the
users only enter particular values into a cell. From the previous example of VLOOKUP and
HLOOKUP Function, we will restrict the users to enter a Class Mixture based only on the
available mixtures in Table 1-2.

Click this to popup


Data Validation
Dialogue Box

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 3: Configure Input Message. To display the message


when choosing for the data in the dropbox (see figure at Step
Step 2:
5), click the Show input message when cell is selected check
box.

Step 4: Configure Error Alert. To display the message when


invalid data is entered on the cell (see figure at Step 6), click
the Show error alert after invalid data is entered check box.

By: Engr. Rizza P. Gamalinda P a g e 17 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

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.

By: Engr. Rizza P. Gamalinda P a g e 18 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
▪ SOME OTHER USEFUL EXCEL FUNCTIONS

▪ 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.

Example: Concrete Proportion for Concrete Slab using Volume Method

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.

By: Engr. Rizza P. Gamalinda P a g e 19 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

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.

By: Engr. Rizza P. Gamalinda P a g e 20 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

Formula
:

Let’s investigate how the formula works!

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))

array Data for column criteria Data for row criteria

=INDEX($B$3:$F$7,MATCH($V$9,$B$3:$B$7,0),MATCH(S11,$B$3:$F$3,0))

array Data for column criteria Data for row criteria

=INDEX($B$3:$F$7,MATCH($V$9,$B$3:$B$7,0),MATCH(S12,$B$3:$F$3,0))

array Data for column criteria Data for row criteria

=INDEX($B$3:$F$7,MATCH($V$9,$B$3:$B$7,0),MATCH(S13,$B$3:$F$3,0))

array Data for column criteria Data for row criteria

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).

By: Engr. Rizza P. Gamalinda P a g e 21 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Notes:
▪ The formula always starts with an equal sign (=), followed by the code for a formula and
ends with appropriate sequence of closing parenthesis. Note that there should be an equal
number of opening and 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.

Example: Concrete Proportion for Masonry Wall using Area Method

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
:

By: Engr. Rizza P. Gamalinda P a g e 22 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

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.

Let’s investigate how the formula works!

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))

array Data for column criteria Data for row criteria

=INDEX($B$4:$G$7,MATCH($R$10,$B$4:$B$7,0),MATCH($Q$12,$B$4:$G$4,0))

array Data for column criteria Data for row criteria

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.

▪ IF COMBINED WITH OR / AND

Formula: =IF(OR(logical #1,logical #2,logical nth),result if true,result if false)


Formula: =IF(AND(logical #1,logical #2,logical nth),result if true,result if false)

In Excel, you can combine IF with AND Functions, or IF with OR Functions to create
multiple conditional situations.

=IF(OR(logical #1,logical #2,logical nth),result if true,result if false) is used whenever


the result satisfies at least one of the logical arguments.

Example: Concrete Proportion for Concrete Slab using Volume Method

Formula
:

If the input data is invalid as per


logical argument, this will result to:

By: Engr. Rizza P. Gamalinda P a g e 24 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Let’s investigate how the formula works!

Formula: =IF(OR(LOGICAL #1,LOGICAL #2,…),Value if True,Value if False)

=IF(OR(L9=B4,L9=B5,L9=B6,L9=B7),"We can solve this.","The Table 1-2 does not have


#1 #2 #3 #4 data for this class mixture.")
Value if True
Logical
Value if False
a. Logical: L9=B4,L9=B5,L9=B6,L9=B7 refers to the cells of criteria required to be satisfied by the
input data. Since the function is IF OR Function, only 1 of these criteria needs to be met. From
example above, the input value in cell L10 is C and the data in logical #4 L9=B7 is C, therefore
the formula will return the argument for true value.
b. Value if true: The function will return “We can solve this.” if one of the criteria is met.
c. Value if false: The function will return “The Table 1-2 does not have data for this class
mixture.” if any of the criteria is not met.

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.

Example: Concrete Proportion for Masonry Wall using Area Method

Formula
:

If the input data is valid as per


logical argument, this will result to:

If the input data is invalid as per logical


argument, this will result to:

=IF(AND(LOGICAL #1, LOGICAL #2, LOGICAL nth), Value if True,Value if False) is


used whenever the result satisfies at all of the logical arguments.

Formula
:

If the input data satisfies all logical arguments, this will


result to a true value.

If the input data did not satisfy all logical


arguments, this will result to a false value.

By: Engr. Rizza P. Gamalinda P a g e 25 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
USE NESTED FUNCTIONS IN A IF FUNCTION

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.

=IF(AND(OR(logical #1,logical nth),OR(logical #1,logical nth)),result if


true,result if false) can be used whenever we have different set of criteria with multiple
options and these criteria must be satisfied simultaneously.

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.

Let’s investigate how the formula works!


Nested function, AND:
Nested function, IF: Opening parenthesis Nested function, AND:
Nested function, OR:
Opening parenthesis Closing parenthesis
Nested function, OR: Opening & Closing parenthesis
Opening & Closing parenthesis

=IF(AND(OR(L9=B4,L9=B5,L9=B6,L9=B7),OR(N9=C3,N9=D3)),"We can solve this.",


OR: Logical #1 OR: Logical #2 OR: Logical #3 OR: Logical #4 OR: Logical #1 OR: Logical #2
Value if true
AND: Logical test #1 AND: Logical test #2

"The Table 1-2 does not have data for this class mixture.")
Value if false
Nested function, IF:
Closing parenthesis

a. Inner Logical for OR Function: L9=B4,L9=B5,L9=B6,L9=B7 matched with


N9=C3,N9=D3 , where any combination will give a true value. From example above,
cell L9 should contain one of the data in cells B4, B5, B6, B7 and N9 must be either
the data between C3 and D3. Other data aside from this will give you a false value
(see figure below).

By: Engr. Rizza P. Gamalinda P a g e 26 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

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.

We don’t have data for 60 kg per bag of cement.

Also, we don’t have data for AAA class mixture.

By: Engr. Rizza P. Gamalinda P a g e 27 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
3. CHOOSE
Formula: =CHOOSE(reference cell,choice#1,choice#2, …)

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.

Example: Concrete Proportion for Concrete Slab using Volume Method

Formula Choices
:

Selected cell where the


choice will be entered
Selected cell where the
equivalent of the choice will
appear

Factors here came from INDEX MATCH Formula

Choice #1
Choice #2
Reference Cell Choice #3
Choice #4
Formula
:

By: Engr. Rizza P. Gamalinda P a g e 28 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

Let’s investigate how the formula works!

Formula: =CHOOSE(reference cell,choice#1,choice#2, …)

=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.

4. SUMIF and COUNTIF / SUMIFS and COUNTIFS


Formula: =SUMIF(array,“criteria″)
Formula: =COUNTIF(array,“ criteria ″)

Formula: =SUMIFS(array,criteria range,“criteria″)


Formula: =COUNTIFS(array,“criteria #1,array,“criteria #2”)

These 4 formulas are great uses of conditional functions.

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

By: Engr. Rizza P. Gamalinda P a g e 29 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
will be ordered for the meantime and will be delivered after 3 weeks when the owner can already pay
the due amount. How much will the owner pay for the 1st batch of supply of materials? 2nd batch?

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.

By: Engr. Rizza P. Gamalinda P a g e 30 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
Let’s investigate how the formula works!

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

By: Engr. Rizza P. Gamalinda P a g e 31 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

Formula Array
:

Criteria

Let’s investigate how the formula works!

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.

By: Engr. Rizza P. Gamalinda P a g e 32 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

Formula Array
:

1
2
3
4
5

Criteria

Formula Array
:

Criteria

Let’s investigate how the formula works!

Formula: =COUNTIF(array,“criteria″)

=COUNTIF(K3:K9, “10 x 20 x 40”)


array criteria

=COUNTIF(K3:K9, “15 x 20 x 40”)


array criteria
a. Array: K3:K9 refers to the range of data that you want to apply the criteria/condition against.
b. Criteria: “10 x 20 x 40” and “15 x 20 x 40” refers to the condition used to determine which
cells to count.

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?

Formula Criteria range Array


:

Criteria

Formula Criteria range Array


:

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.

Let’s investigate how the formula works!

Formula: =SUMIFS(array,criteria range,“criteria″)

=SUMIFS(M3:M9, K3:K9,“10 x 20 x 40”)


array criteria criteria
range

=SUMIFS(M3:M9, K3:K9,“15 x 20 x 40”)


array criteria criteria
range

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.

By: Engr. Rizza P. Gamalinda P a g e 35 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)
From the problem, we have 2 given conditions for doors and windows, whether they are: (1)
received & installed and (2) or pending & not yet installed.

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.

By: Engr. Rizza P. Gamalinda P a g e 36 | 37


CEP211L: Computer Fundamentals and Programming 2 (Laboratory)

Let’s investigate how the formula works!

Formula: =COUNTIFS(array,“criteria”, array,“criteria”)

=COUNTIFS(C3:C20,“Received”,D3:D20,“Installed”)
array criteria array criteria

=COUNTIFS(C3:C20,“Pending”,D3:D20,“Not yet installed”)


array criteria array criteria

=COUNTIFS(F3:F20,“Received”,G3:G20,“Installed”)
array criteria array criteria

=COUNTIFS(F3:F20,“Pending”,G3:G20,“Not yet 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.

By: Engr. Rizza P. Gamalinda P a g e 37 | 37

You might also like