Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
1-матрицы и БД-2.doc
Скачиваний:
5
Добавлен:
01.03.2025
Размер:
4 Мб
Скачать
☆

Basic functions : subtotal

March 2nd, 2005

n SUBTOTAL function allows you to perform basic spreadsheet operations on the visible cells in AutoFilter mode.

In the example below, we have sales figures for 4 salesmen - George, Paul, Ringo and John.

After we apply the AutoFilter to display only the sales related to Paul, we use SUBTOTAL as shown to average his sales.

The SUBTOTAL function takes two arguments:

SUBTOTAL(function; range)

Function is a number that stands for one of the following functions:

1 AVERAGE 2 COUNT

3 COUNTA 4 MAX 5 MIN 6 PRODUCT 7 STDEV 8 STDEVP 9 SUM 10 VAR 11 VARP

If you do not wish to use AutoFilter, you can use a combination of SUMIF and COUNTIF as shown below to achieve the same results - at least as far as averaging is concerned.

Adding notes to cells

Adding notes is straightforward. Follow these illustrated examples on making the most of this Calc feature

Adding a note: Select the cell you wish to annotate and clickInsert - Note as is shown below.

You can now add a comment in the newly created box. To finish adding a comment and close the box, select another cell.

Cells with attached notes have a tiny red mark visible in the upper right corner - and the note can be viewed by moving the cursor over the cell.

This entry was posted on Wednesday, November 10th, 2004 at 9:03 p

A simple recursive macro: gcd

September 9th, 2004

p>In mathematics, the greatest common divisor (abbreviated GCD), or highest common factor (HCF) of two integers which are not both zero is the largest integer that divides both numbers.

The GCD of a and b is often written as gcd(a,b) or simply (a,b). For example, gcd(12,18) = 6, gcd(-4,14) = 2 and gcd(5,0) = 5. Two numbers are called coprime or relatively prime if their greatest common divisor equals 1. For example, 9 and 28 are relatively prime.

The greatest common divisor is useful for writing fractions in lowest terms.

The algorithm for determining the GCD of two numbers is known as a recursive algorithm - and the OpenOffice Basic code is listed below..

Function gcd(a As Integer, b As Integer) As Integer If b = 0 Then gcd = a Else gcd = gcd(b,a) End If

End Function

Posted in OpenOffice Basic | No Comments »