Вы находитесь на странице: 1из 9

Week 3: Formulas and Functions (Part 1)

Start of transcript. Skip to the end.


Welcome back! This week will focus on data manipulation and mathematical functions for simple
automation. The first half deals with proper date entry and text data manipulation. We will then learn
about data analysis with the use of counting and applying mathematical functions. You will be asked to
create worksheets that apply basic date notation, text functions and/ or data analysis. Don't forget to
secure your own notes about the topics to serve as your reference later on.

At the end of this week, you will be able to:

a. determine and use proper date notation;

b. manipulate text within cells by joining or splitting text strings to retrieve partial data; and 

c. perform mathematical functions on a cell for basic data analysis.


3.2.1 Demonstration: Y2K Problem; NOW and TODAY
Functions; YEAR, MONTH, DAY and WEEKDAY
Functions
Start of transcript. Skip to the end.
So we begin with a short discussion on the Y2K Problem, before the year 2000 dates were generally
listed in 6 digit formats, it started in the early days of the development of the computers wherein data
was very expensive, data storage was very expensive, and it seemed, at that time, it seemed okay to
save a few bits of data, and they took out the century so they took out the 19. In this example we can
see, using a function that we’ll discuss later, the day, the month and the year for excel, it identifies the
year in this example as 20 but if we place an earlier date, let’s say 1901 it references the year 1901
properly, if we place in a earlier date like 1895, it returns an error value or a different value for the date
which we’ll talk about later. So it’s this early—it’s nice to remember that excel started—starts counting
dates from the year 1900 and that is their year 1, anything earlier than that returns a different value,
we’ll discuss that in a bit. So there are, there are several functions that deal with dates. The Now and
Today Function seen here as type in—returns the date for today, so now—so as I am doing this it is this
date and for today it returns just the date, part
of the reason for saving space was digital memory
is very expensive so excel has created several functions which makes it easier to
call out dates or return dates, for this function, the formula simply is as follows.
It allows for you to call the specific time and
date and for today, the today function it returns the date today.
The
following functions are used to break down the specific date into the year, month,
day, and the week day, so given the date January 1, 1919 entering the function year
returns the year of that date, the month, and the week day of that specific date.

Now and Today Function

These funcions return the current date within the cell. Particularly useful in documenting spreadheets; it
allows the user to tag the document with the date or time (for example in a receipt.)

Year. Month, Dat and Weekday Functions

Individually, these functions extract details from date entries. It allows the user to retrieve particular
information from various formats of dates. These are also important to use with the DATE() function.

Year- show the year for a selected date

Formula: = YEAR (serial number)

Serial number of simply date


3.2.2 Demonstration: DATEDIF Function; DATE and
DATEVALUE Functions; TRIM and VALUE;
CONCATENATING Text

The DATEDIF Function returns a numerical value that denotes the number of years, months, or days
between 2 dates, so given this example we’re setting 2 values, starting on January 7th of 1902 then our
end date of December 31 2019, calling the function DATEDIF which we highlight why it returns a
hundred and seventeen years between 1902 and 2019 when it is—when M is denoted it returns number
of months and when D is denoted in the function, it returns the number of days. The DATE Function is
able to splice together the day, month, and year into our regular day, month, year format so given the
following syntax which references—in this case: G106, G106 for our year, and then F106 for our month,
E106 for our day it returns as the completed date as follows, 31/1/1920. Our DATE VALUE Function, as
earlier mentioned, excel begins the counting of dates as if it were a serial number starting from 1900. So
when we ask for the DATE VALUE, again the function is DATE VALUE, then you determine the reference
cell it essentially counts the number of days from 1900, so this is the serial—serial number version. In
this example we’ll see an entry wherein there are several spaces before Metro Manila, it could be a data
entry error but to clean up the text you can simply type TRIM and select the reference function—the
reference cell and then it is able to remove all spaces for words or cell—text entries, text strings except
those with spaces between the words. The VALUE Function, in this case it’s 1.1 million five-hundred
thousand, to remove the—to turn it into a numeric value since this is entered as a text string notice the
apostrophe at the beginning. To convert this into a value string, you can simply type VALUE—the VALUE
function and then a reference—a reference cell. Still working with text sometimes we may have data
entries across several cells that we want to bring together. So in this example, we can put together data
entries let’s say Manila, NCR, and the Average Growth Rate which is .78. If we wanted to CONCATENATE
and bring together—just bring together the text, we simply type CONCATENATE and then our first data
entry which is the City and then our second data entry which is the Region and then our third data entry
which is Average Growth Rate. So for—it’s also possible to enter our CONCATENATE text by entering it
as a formula, here you can see still the same set, we have here province so D18, E18, F18 with the
ampersand character and the cell entry as a formula.

DATEVALUE- converts a date in the form of text to a number that represents date in excel date-time

Formula: =DATEVALUE(date text)

Date text can be “1-1-19” or typed in cell as 1-1-19

DATEDIF FUNCTION- this function allows the user to get the number of days, months, or years between
two dates. It calculates the time between the start_date and end_date. The user can determine the
returned result by the unit, as defined in the next slides.

Syntax

=DATEDIF (start_date, end_date, unit)


DATE- returns the number that represents the date in excel date-time code. This will combiner numbers
that represent date in date format.

Formula: = DATE(year, month, day)

Year, month, day- value o cell references

DATE VALUE- converts a date in the form of text to a number that represents date in excel date-time.
(serial number version)

Formula: = DATEVALUE(date text)

Date text can be “1-1-19” or typed in cell as ‘1-1-19’

TRIM AND VALUE FUNCTIONS

Trim Function – removes all spaces from a text string except for single spaces between words

VALUE- converts a number of text string to numerical string for mathematical operations

CONCATENATING TEXT- is putting several text strings together, on after the other, without changing the
contents of each text string. It is possible to concatenate contents of a cell with text strings.
3.2.3 Demonstration: Parsing with Common Text Values
Another valuable function when working with text is Parsing, parsing is the analysis of a data string and
the extraction of usable data. Our first function for Parsing is the DOLLAR Function, it needs 2 entries,
the first is the cell reference and then the number of decimal places, so it’s entered as follows and
returns your data—your numeric value into a value with the prefix. LEFT, the LEFT Function returns the
number of letters of your text string as specified in the function, there are 2 entries, again the cell
reference, we begin with the cell reference where for in this case is the number of letters starting from
the left of your text string. For LEN or length of your text string it returns a value in terms of the number
of characters, so for example in this case Metropolitan Manila if I apply the function LEN referencing this
cell it returns our value which is 19. The RIGHT Function, corresponds to the number of text or
characters from the right so in this case we’re counting 6 characters from the right. Our LOWERCASE
Function converts all letters to lowercase, all our characters to lower case, it only requires 1 data entry—
1 cell reference. For PROPER, for the function PROPER, it also manipulates the text string in this case
there’s no capital letters, it makes the text string into a proper case text string. The UPPERCASE Function
converts the full text string into all uppercase letters, again there’s only one text function required for
this, i’m replacing errors for this example. Using the REPLACE Function wherein this entry, it allows you
to specify the first cell wherein the entry is incorrect and then the number—the location in that string, in
this case 2 and then the number of characters from that letter and then you replace it with
the specified string E, which corrects the string from this one to this one. The REPETITION Function gets
your text string in this case letter K and you are able to specify how many times it repeats so it only
requires 2 data entries: cell reference and the number of times it is repeated. So if you’re going to make
this into ER it will repeat the text string one after the other, so as test, our entry is this cell and then it
repeats it 3 times. We want to find the text within the text wherein we can find the word Manila and
return the number of characters from which the word can be found within the text string. The
SUBSTITUTE Function in this case allows you to find a specific string within a cell in this case we want to
change the word Metropolitan into City of Manila so our function SUBSTITUTE our cell reference, the
text that we want to replace enclosed still with quotation marks, the next is the new text that we want
to replace it with and how many times we want to replace this text, in this case just one time, so it will
turn City of Manila.

PARSING DATA WITH COMMON TEXT FUNCTIONS-Parsing is the analysis of data strings and the
extraction of useable data. Through excel, this data can be separated and reorganized according to
criteria the user can set. This is a list of the functions associated with this feature.
3.3.1 Demonstration: COUNTIF, SUMIF and AVERAGEIF
Functions
Start of transcript. Skip to the end.
So our discussion today will center around COUNTIF, SUMIF, and AVERAGEIF Functions, these are
specific action functions which rely on a criteria before applying the function to the given rage.
So we’ll use our data set here on the left, so we’ll have the province, the region and the average growth
rate and we’ll apply COUNTIF, SUMIF, AVERAGEIF to these as we go along. To begin, COUNTIF is used to
count cells if the given condition is met or the given condition returns through as an answer, so
following the proper syntax, we type in our function, as you see it requires 2 entries so the range on
which it is applied and the criteria that is referenced. For range we will select under column C or for the
region and then we define—don’t forget your comma in between, then we define our criteria here in G2
and it returns our COUNTIF. The region within C has NCR, so we can also hard code our criteria so we
select a range, and to reference our criteria, we can specify CAR or cordillera administrative region as
our criteria. To check, we can see that for NCR which is our first test, the count is 17, and then for CAR
the count is 7 so that’s the COUNTIF function, to see, to toggle our formulas, there’s our formula then
we can now move to our SUMIF Function. SUMIF functions are used to some selected cells or a range
when the answer to the given criteria returns through. So our criteria again will be NCR criteria one, our
reference range, the column under region so we type in SIMIF, our range, specify it again, and comma,
and our criteria is still NCR and then the sum range or the entries that will be added to get sum is under
the average growth rate. So we close of, so to see, even if we selected the whole range for both region
and average growth rate it will only add and sum up all the details—all the average growth rate under
NCR which is sum 26.11. For AVERAGEIF Functions it is used to get the arithmetic mean of selected
cells or range on the answer to the given criteria is true. We should type in our function and then don’t
forget the IF, AVERAGEIF, so our range, we continue our range, and then our criteria still is NCR and their
average range. So to recap, the range or the cells were the criteria will be tested is your first entry,
this one, and then our criteria is our second entry into the function and then the last entry will be the
range on which the function will be applied. So for the SUMIF and AVERAGEIF functions you are required
2 criteria for the function to be applied. Okay there you go.

COUNTIF, SUMIF and AVERAGEIF functions -these are control functions wherein the cells are counted,
summed or average if the criteria is met. These are functions that are only performed based on a single
criteria, within a single range of data sets. Counting, summing, or averaging of cells occurs within the
specified range IF the condition is met.
Demonstration: COUNTIFS, SUMIFS and AVERAGEIFS
Functions
Start of transcript. Skip to the end.
Here the functions are still the same but allowing for more criteria to be considered. For our first criteria
we’ll still specify NCR and then we would take on a second criteria wherein we define all the numbers
greater than two will be added or applied to the function. So COUNTIFS—similar to COUNTIFS but this
time with multiple criteria it will only apply the COUNT function to cells which meet both criteria.
In this case we will be using our greater than sign or our wildcard operators, so we can specify a range
for example in this case above 2 so our criteria range first will be the region and then you specify the
first criteria corresponding to that region, then our second criteria range or our average growth rate,
and then we specify our second criteria. It’s important to note that the criterias have to match the data
types that you are using or an error value or error message may be returned if it does not match. So if
we go through our 17 entries we can only see one, two, three, and four entries that have values greater
than 2. So moving along to use the SUMIFS function we will apply only if both criteria are met so in this
case our first range again and our criteria from the first, then our sum range or the values that have to
be summed or added together, and then the criteria which is greater than 2.
So don't forget the S and let’s check again. Let me start over with SUMIFS—so SUMIFS and then some
range, so we have to specify first the range on which we will apply the SUM function and then we define
the range for our criteria 1 and then we select the criteria which is NCR, let me do that again, and then
with the limiter specifying NCR and then for our criteria range 2, we specify values greater than 2. This
will only add the following, so if we apply from our previous lesson apply highlight cells greater than 2 so
you can see which functions—which values we will add, so this 4 return as a value of 11.07 so our
SUMIFS function only added entries under average growth rate for NCR—that the value is greater
than 2. For AVERAGEIFS function we specify again our average range so we can highlight a whole range,
I'll show you later why, and our criteria range 1 which is the region, we specify as—you specify the
region as only NCR, and then our criteria range 2 and we only want the average of all values greater than
2, so to check our average is 2.7675. Why do we use this—these functions in—in a dynamic worksheet
we can change our criteria simply by changing the entries in the reference cells. So for criteria 1, you can
look at CAR and the only value greater than 2 is 2.08 so our SUMIFS and AVERAGEIFS function return
2.08 and there is only one greater than 2.

COUNTIF, SUMIF and AVERAGEIF functions – a variation of the count, sum and average functions; these
allow the same operation across multiple data sets based on multiple criteria. These are functions that
are only performed based on several criteria, and can be used across several ranges of data sets.
Counting, summing or averaging of cells occurs within the specified ranges only when all conditions are
met.
3.3.3 Demonstration: SUMPRODUCT Functions
Another variation of the preceding functions SUMPRODUCT takes it a step further by
allowing these processes across several arrays within one function, this may seen like a
complex function and practice is important.
The SUMPRODUCT Function is used to sum the product of corresponding ranges or
arrays the user can use the following syntax in calling the SUMPRODUCT function.
SUMPRODUCT requires more than one array and while it is base—it’s base
functionalities numeric the SUMPRODUCT can handle even true or false statements.
Let’s try it in the following example: let’s say you have an inventory of rice as seen
in this slide you have: wild, black, brown, special
white, regular white rice.
You have column E for the cost, column F for the size,
and column G for the count, so each variant or each rice type already has a different
variable corresponding to it, so the cost we establish as numeric value 130 for wild
and so on, the size in kilograms is the weight for each of the type—types of rice and then
you have the count meaning the number of packs that you have in your inventory.
So our formula for the total value as you’ll see will
be: function SUMPRODUCT the first range E7 to E11, the second entry is F7 to F11,
and then G7 to G11.
So we highlight the ranges: fist array, and the second array, and
the third array.
So our total value is 127,000 pesos, that’s the total value of our
inventory.
It considers our individual cost, individual size, and individual count.
if you want to look at our average value, let’s
say for our total value and then we divide by the
SUMPRODUCT of the size per rice type versus our total inventory and our cost average
for all our product will be as follows.

SUMPRODUCT- This is a mathematical function in Excel that requires input arrays to operate. It is used
as a two-step process for data in one or more arrays. An array is a list or range of cells. In this function,
each item in the array will be multiplies to the corresponding cell in the next array and so on. All the
products from each array will be summed.
3.3.4 Demonstration: Short Exercise
Start of transcript. Skip to the end.
From the same data set, we are able to extract the average cost of the products.
This is the weighted average in that the total value
is divided by the total volume per product.
So the full formula has the SUMPRODUCT found in each 12 over the SUMPRODUCT
of column F and column G.
For a short exercise, each array should contain the same count of cells for the function
to work, always remember that only columnar data is considered by this function.
Given any set of cells examine each of the following below: so for SUMPRODUCT cell
B1 to B5 and C2 to C6, SUMPRODUCT of C3 to C7 by D3 to D7, SUMPRODUCT of
D5 to D9 by E4 to I4, and SUMPRODUCT of E5 to E9, F5 to G9.
Take a minute to analyze which will work and try to plot it
out you can write it down and from the 4 sample formulas, define which of the 4 will work
and which of the 4 will return an error message.
So the answers are as follows, you consider the very first scenario: B1 to B5 and G2 to
G6 it is still the same length though it is non adjacent arrays, it is still allowable.
For the second scenario C3 to C7 and D3 t D7 it is the same length and adjacent arrays
as used in our earlier example.
For the last two, only columnar values are considered so D5 to D9 by E4 to I4 is a row
of data, it will not be allowed.
For the 4th example, E5 to E9 by F5 to G9 while it is still—has the same number of
rows, F5 to G9 is a 2 x 5 array, so keep in mind when using the SUMPRODUCT
function, it is important that the data should match when you apply the SUMPRODUCT
function across 2 different arrays or more.

SUMPRODUC- From the same data set, we are able to extract the average cost of the products. This is
the weighted average in that the total value is divided by the total volume per product.

=SUMPRODUCT (E7:E11, F7-F11, G7:G11)/SUMPRODUCT(F7:F11, G7:G11)

Вам также может понравиться