- •Auto Filling Cells
- •Filling a Cell Range with a Series
- •Filling a multiplication chart
- •Paste Special I
- •Paste Special II - Removing formulae
- •Using Names as constants
- •Conditional Formatting I
- •Conditional Formatting II
- •Conditional Formatting III
- •Conditional Formatting IV : Masking errors
- •Adding a background graphic
- •Basic functions : sumif
- •Cell Counting 1: countif
- •Ranking and sorting data I
- •Conditional summation revisited
- •Largest values in an array
- •Date & Time Basics
- •Date & Time : Calculating Dates of Holidays
- •Financial Functions 1 : Mortgage calculation
- •In this case, we are calculating the future value of loan one time period in the future, based on the present loan value and interest rate.
- •Financial Functions 2: Accumulation
- •Financial Functions 3 : Complex Accumulation
- •Financial Functions: cumipmt & cumprinc
- •Financial Functions: Calculating Principal & Interest
- •In case you need further convincing, the ipmt and ppmt components are summed in column e, and are constant throughout the life of the loan - as expected.
- •Array Formulas: Working with Matrices
- •Datasources : Spreadsheets
- •Datapilot Revisited
- •DataPilot Revisited II
- •Data Filtering : Standard Filter
- •Data Filtering : Advanced Filter
- •Basic functions : subtotal
- •Adding notes to cells
- •A simple recursive macro: gcd
Largest values in an array
March 9th, 2005
An array formula I came across that lists the largest N values of an array.
In the example below, D1:D5 contains the five largest values fromA1:A13
Posted in Function Tips | No
Date & Time Basics
August 31st, 2004
Creating a column of consecutive dates is easy with the OOo Calc tool.
The formulas below illustrate how to increment a particular date by a given number of days, months, or years…
Posted
Date & Time : Calculating Dates of Holidays
October 4th, 2004
This particular exercise in developing formulas for each of the major US holidays is a good way to develop expertise in OOo Calc date manipulation.
US holidays follow simple guidelines for the dates on which they fall. Some holidays fall on specific dates , such as New year’s day on January 1st and independence day on July 4th. Other holidays fall on specific days within the month. For example, Memorial Day is the last Monday in May and Thanksgiving Day is the fourth Thursday in November.
The OOo Calc functions that will feature prominently in this exercise are
DATE(year; month; day) Returns formatted date corresponding to specified year, month, and day values.
WEEKDAY(dateValue; type) Returns a decimal value corresponding to the day of the week for the input date.
Before we tackle the US holidays problem, let us become more familar with the above functions and how they are used in OOo Calc formulas.
The DATE function allows us to define and manipulate a dates components - year, month, and day - independently. We have already seen this in an earlier tip
The WEEKDAY function returns a decimal value between 1 & 7 corresponding to the day of the week for the specified date. By invoking the TEXT with the appropriate formmating, we can convert the output of the WEEKDAY function to something more meaningful. In the example below, both formats are shown. The last two formulas show one approach to determining the first day-of-week after a specified date.
The table below generates the 10 major US holidays for a specified year - in cell C2
New Year’s Day =DATE(C2;1;1)
Martin Luther King Jr. DayThis is the third Monday in January. =DATE(C2;1;IF(2<WEEKDAY(DATE(C2;1;1));10-WEEKDAY(DATE(C2;1;1));3-WEEKDAY(DATE(C2;1;1)))+14)
President’s Day This is the third Monday in February.
=DATE(C2;2;IF(2<WEEKDAY(DATE(C2;2;1));10-WEEKDAY(DATE(C2;2;1));3-WEEKDAY(DATE(C2;2;1)))+14)
Memorial Day The last Monday in May, we subract 7 days from the first Monday in June. =DATE(C2;6;IF(2<WEEKDAY(DATE(C2;6;1));10-WEEKDAY(DATE(C2;6;1));3-WEEKDAY(DATE(C2;6;1)))-7)
I leave the rest for you as an exercise!
Posted
Financial Functions 1 : Mortgage calculation
At some point, you will want to use OOo Calc to perform some sort of financial analysis. Like other topics I cover, you could write a whole book on this. As an introduction to the topic of financial functions in OOo Calc, we will look at a home mortgage example.
The PMT function calculates the regular payments needed to pay off a specified loan at a specified interest rate in a specified number of payments periods.
The arguments to the function are :
PMT(rate, nper, pv, fv, type) where
rate The interest rate for each of the tune periods in the nperargument. (see below)
nper The number of time periods between now and the end of the loan. For a standard 30-year ,ortgage - with monthy paymnets - this is 360.
pv The present value (or initial value) of the loan. Also known as the principal <lifv The future value of the loan (desired) at the end of the nper payment periods. For mortgage payment calculations, this would normally be 0.</li
type Optional argument which controls whether payments are made at the start of a period or the end.
In the example below, we have a 30-year mortgage, $100k to be paid off monthly at an APR of 8%.
The monthly payment on this loan turns out to be $733.76. What we would also like to know is how our principal decreases over time. Each monthly payment is split between interest and principal. Early on in the repayment schedule, a greater percentage of the payment is set aside for interest.
The formula for calculating the principal balance at the end of each period (D10:D369) is as follows.
=FV(rate; nper; pmt; pv)
