@ FUNCTIONS

This set of instructions is used in conjunction with the Lotus
1-2-3 file ADV@FUNC.WK1 which is a demonstration of certain
built-in @ functions.  By following these instructions you should
be able to understand the demonstrations.


Retrieve the file ADV@FNC.WK1
Press:   /
Select:  File
         Retrieve
         ADV@FNC.WK1
Press:   <RETURN>

Follow the instructions on the screen to see and examine the     
@ functions listed in the Module Menu.

The file contains several of the more widely used @ functions
with simple examples of how they can be used.  The aim is to
provide Lotus 1-2-3 users with a ready reference of some of the
functions so that familiarity and subsequent use will be
enhanced.

A complete list of the @ functions (both Release 1A and 2) is
contained in the file named FUNCTION.WK1 which can also be
downloaded from the ITC Bulletin Board, 275-1050.

Press:   F5 [GOTO]
Type:    1
Press:   <RETURN>

In Module 1 the @ROUND and @INT functions are examined.

The @ROUND Function is used to round numbers to a specified
precision.  The general format of the function is

     @ROUND(value or formula,number of decimal places)

The advantage of the @ROUND function over the /Range Format Fixed
command is that you avoid the errors inherent with adding rounded
amounts.  This is demonstrated on the screen.

Move to:  A28-A31

Notice that the value in A28 is 9.465, but that it is rounded to
9.47 by the default (2 decimal places) format.  

Move to:  A35-A38

The sum of A35 + A36 demonstrates the errors inherent with using
the Range Format Fixed Zero command.

Move to:  D28-D31

The accuracy gained by using the @ROUND function is demonstrated
here.

The @INT function computes the integer portion of a number or
cell reference.  The general format of the function is:

               @INT(number or cell reference)

Move to:  D35-D38

Notice that unlike the @ROUND function the @INT function simply
truncates all digits to the right of the decimal.

Press:    F5[GOTO]
Type:     2
Press:    <ENTER>

In Module 2 the @RAND function is examined.

The @RAND function generates random numbers between 0 and 1 with
up to eight decimal places.  The general format of the function
is:
          
                       @RAND

Move to:  A50-D52

Note that each time the F9[CALC] key is pressed the cells
containing the @RAND function will display a different value. 
Values between one and ten can be produced by multiplying the
function by 10.

Press:   F5[GOTO]
Type:    3
Press:   <ENTER>

In Module 3 the date functions are examined.

The most commonly used date function is @DATE.  This function
allows you to convert a date into an integer that 1-2-3 can
interpret.  The form of the @DATE function is:

         @DATE(year number,month number,day number)

Move to:  C66-D66

Cells C66 and D66 show the integer and /Range Format Date option
1 (DD,MM,YY) forms, respectively.  There are three /Range Format
Date command options available in Release 1A and five in Release
2.  They are:

1.  (DD-MMM-YY) *            * Release 1A
2.  (DD-MMM) *
3.  (MMM-YY) *
4.  (Long International) (MM/DD/YY)
5.  (Short International) (MM/Day)

Move to:  C68-D69

@DATEVALUE is a variant of @DATE producing a serial number (C68)
but unlike the numeric arguments of @DATE, a string argument is
used with @DATEVALUE.  The general form of the function is:

         @DATEVALUE("date string")

The date string must conform to one of the five /Range Date
Format options.  If so, 1-2-3 will display the appropriate
integer.  Cells C68..D69 show variations on both function
argument and range format form.

Move to:  A71-D71

The @NOW Function returns today's date and time as an integer. 
It replaces the @TODAY function used in Release 1A.  The numbers
to the right of the decimal correspond to the time serial.  The
general form of the function is:

                           @NOW

In cell D71 today's date is displayed in the (DD,MM,YY) format.

The @YEAR, @MONTH, and @DAY allow you to extract parts of a date
in integer form.  The general form of these functions are:

         @YEAR(cell reference or date function)
	      @MONTH(cell reference or date function)
    		  @DAY(cell reference or date function)

Move to:  A73-D77

Suppose your birthday was March 5, 1951 (C73 and D73) you could
compute your age by subtracting your birthday (C73) from today's
date (C71) and the number of days until your next birthday by
subtracting today's date (@NOW) from your next birthday (D77)


Move to:  C79-D79

Examples of @DAY and @MONTH are shown in C79 and D79,
respectively.

Press:    F5[GOTO]
Type:     4
Press:    <ENTER>


In Module 4 the time functions are examined.

As mentioned earlier 1-2-3 expresses time in fractions of serial
numbers between 0 and 1.  For example .5 is equal to twelve hours
(or 12:00 p.m.).  In addition, military time is used:  10:00 p.m.
in normal time is 22:00 in military time.  The @TIME function
arrives at a serial number for a specified time of day.  The
general form of the function is:

	     @TIME(hour number,minute number,second number)

The numeric arguments have certain restrictions.  First, the hour
number must be between 0 and 23.  Second, both the minute and
second number must be between 0 and 59.  Finally, 1-2-3 truncates
all but the integer portion of the numeric arguments.

The /Range Format Date Time command provides four options to
display the time in a more recognizable way.  They are:

1.  (HH:MM:SS AM/PM)
2.  (HH:MM AM/PM)
3.  (Long International)(HH:MM:SS 24 hours)
4.  (Short International)(HH:MM 24 hours)

Move to:  A89-D95

In cells A89 and A90 @NOW is formatted in the new international
time formats.  @INT can be used to eliminate the time value
(A93).  @TIME with hour, minute, and second arguments are shown
in A95 and D95.

Just like @DATEVALUE and @DATE, @TIMEVALUE is a variant of @TIME. 
Like @TIME, @TIMEVALUE produces a serial number from the hour,
minute, and second arguments you give to the function.  But
unlike @TIME which uses numeric arguments, @TIME uses string
arguments.  The general form of the function is:

	       @TIMEVALUE("time string")

Move to:  A97-D97

The results of @TIMEVALUE displayed in serial and Long
International form are shown in cells A97 and D97, respectively.

The time right now in hour, minute and second formats resulting
from the @HOUR, @MINUTE, and @SECOND functions are shown in cells
A99, D99, and D101, respectively.  The general form for these
functions, which allow you to extract different units of time
from a numeric time fraction is:

            @HOUR(day/time value argument)

Press:    F5[GOTO]
Type:     5
Press:    <ENTER>

In Module 5 the @MOD and @CHOOSE functions are looked at.

The @MOD function returns the remainder (modulus) from a division
with a general format of:

             @MOD(number,division)

Examples are shown in cells A109 and F109.  The remainder of the
@NOW date/time function whose division is seven returns the date
time serial number shown in F109.  When used with the @CHOOSE
function (A112 and F112) the day of the week is returned.

The @CHOOSE function uses a key value provided by the user to
select a number from a list.  This function has the following
form:

	        @CHOOSE(key,argument,argument, . . .,argument)

@CHOOSE displays the arguments whose position on the list matches
the key (with the first position corresponding to a key of 0, the
second position corresponding to 1, etc).  The first argument
(the key) can be a number, a formula, or a function with numeric
value.  The remaining arguments can have either numeric or string
values.

Press:     F5[GOTO]
Type:      6
Press:     <ENTER>

In Module 6 the the financial function @PMT is reviewed.

The @PMT function calculates the mortgage payment required for a
given principal, interest rate, and number of periods.  The
format of the function with n equalling the number of periods is:

           @PMT(principal,interest n)

Move to:  A127-A129

The values in cells A127-A129 represent the function arguments. 
They have been given the Range Names shown in the example.  The
yearly payments are shown in A132.  The monthly payments are
shown in A134.  Note that in order to compute the monthly
payments the interest rate and period arguments are divided by
12.  Each time any of the variables (argument values) is changed
the answer is automatically updated.


Press:  F5[GOTO]
Type:   7
Press:  <ENTER>

In Module 7 the @PV function is looked at.

The @PV function is used to calculate the present value of an
ordinary annuity given a payment per period, an interest rate,
and the number of periods.  An ordinary annuity is a series of
payments made at equally spaced intervals and present value is
the value today of the payments to be made or received later,
discounted at a given interest rate.  The general form of the
function is:

		     @PV(payment,interest,term)

The @FV function is similar in form to the @PV function, but is
used to calculate the future value of an ordinary annuity. 
Future value is the value at a given day in the future of a
series of payments or receipts, dicounted at a given interest or
discount rate.  The @FV function looks like this:

		    @FV(payment,interest,term)

Move to:  A148-A150

The values in cells A148-A150 represent the function arguments
for both @PV and @FV examples shown in cells A153 and A155,
respectively.  They have been given the Range Names shown.

The @RATE function calculates the compound growth rate for an
initial investment that grows to a specified future value over a
given period.  The rate is the periodic interest rate and not
necessarily an annual rate.  The format for this function, where
n equals the number of periods, is:

		    @RATE(future value,present value,n)

The yield on $1,285.77 worth $10,357.11 in 30 years is shown in
the example (A157).

Press:   F5[GOTO]
Type:    8
Press:   <ENTER>

In Module 8 the @TERM and @CTERM functions are looked at.

The @TERM function calculates the number of periods required to
accumulate a specified value by making equal payments into an
interest-bearing account at the end of each period.  The form for
this function is:

	            @TERM(payment,interest,future value)

The results of this function are demonstrated fin A175.

Move to:  A177

The @CTERM function calculates the number of periods required for
an initial investment earning a specified interest rate to grow
to a specified value.  @TERM calculates the number of periods
needed on the basis of a series of payments to grow to a
specified future value at a specified interest rate.  The CTERM
function arguments specify the present value, and the interest
rate, and finds the required number of periods.  The form is:

               @CTERM(interest,future value,present value)

The example returns the same number of periods required as in
@TERM.  The difference is that the arguments used to arrive at
the answer are different.

Press:    F5[GOTO]
Type:     9
Press:    <ENTER>

In Module 9 the @DDB function is examined.

The @DDB function calculates depreciation using the double
declining balance method, with depreciation ceasing when the book
value reaches the salvage value.  The form of the @DDB function
is:

               @DDB(cost,salvage value,life,period)

In general, the double declining balance depreciation in any
period is book value * 2/n, in which book value is the book value
in the period, and is the depreciable life of the asset.  1-2-3,
however, adjusts the results of this formula in later periods to
ensure that total depreciation does not exceed the purchase price
less the salvage value.

The example (A210) shows the depreciation in year four of an
automobile which cost $15,000, has a life of 10 years, and a
salvage life at the end of 10 years of $3,200.

Move to:  H197

In this small data table (notice the @DDB function formula in
this cell) the depreciation for each of the first four years of
the life of the automobile are calculated and the value of the
automobile at the end of four years shown (H203).


Press:     F5[GOTO]
Type:      10
Press:     <ENTER>

In Module 10 the @NPV function is looked at.

The @NPV function computes the net present value of a stream of
cash flows.  The form of this function is:

	       	@NPV(discount rate,range of values)

The discount rate is the interest rate 1-2-3 uses to compute the
net present value.  The range is the stream of cash flows to be
discounted.  The interval must be constant and must agree with
the period of the discount rate.

Move to:  A224

The example shows the net present value on a purchase of property
which will return the earnings listed in the Range Named
EARNINGS.  If the NPV is greater than the cost the investment can
be considered as meeting your objective of at least a 10 percent
return.  Change the interest rate in the table to another value. 
Observe the difference.



                                                                                                            