- •Functions and formulas
- •5.1 Understanding Functions and Formulas
- •The a1 reference style
- •5 .2 Linking Worksheets
- •5.3.1 Operators in Excel Formulas
- •Example 5.2
- •5 .3.2 Absolute and Relative Reference
- •Example 5.3
- •5.4.5 All in One: Subtotal
- •Example 5.9
- •5.5 Using Functions and Formulas
- •5.5.1 Date and Time Functions
- •5.5.1.1 Date()
5.4.5 All in One: Subtotal
Subtotal is a very flexible formula and can be used to summarize the tables or lists. It is generally easier to create a list with subtotals by using this command in the Outline group on the Data tab. You have 11 common functions included in this aspirin function. Once the subtotal list is created, you can modify the function number anytime to change to the desired SUBTOTAL function.
Function numbers have two variants: the first type includes the hidden rows/columns where the other ignores them.
=SUBTOTAL(function_num, ref1, ref2, ...)
Example 5.9
Here is how you could solve the previous example with this function.
Solution:
For the first student, in cell Y3, write the formula =SUBTOTAL(102, C3:X3) and for the total hours skipped, in cell Z3, write = SUBTOTAL(109,C3:X3).
Here, we use function numbers 102 and 109. You could also use 2 and 9, it’s up to your project design. The difference is that 109 excludes the hidden rows (if any), 9 doesn’t pay any attention to hidden rows. And now, copy these formulas for the other students.
5.5 Using Functions and Formulas
In the previous section you studied how to define your own formulas and use some common functions. In this section you will study the usage of other predefined formulas and to get help with them.
To explain all these functions we need several books. Nevertheless, we’ll try to explain some useful functions that you might need.
5.5.1 Date and Time Functions
5.5.1.1 Date()
You can easily enter a date into a cell by simply typing it while using any of the date formats that Excel recognizes. On the other hand, we also have a Date function to convert numbers into date format. The DATE function takes three arguments: the year, the month, and the day. The following formula, for example, returns a date comprised of the year in cell A1, the month in cell B1, and the day in cell C1:
=DATE(A1,B1,C1)
Date function is useful when you want to create and manipulate a date yourself using numbers. See the section “5.5.1.8 Counting by Months or Years” for an example.
