Add-in Functions

The following describes and lists some of the available add-in functions.

Ý niệm Bổ trợ

You will also find a description of the LibreOffice Calc add-in interface in the Help. In addition, important functions and their parameters are described in the Help for the .

Phần bổ trợ được cung cấp

LibreOffice chứa một số mẫu thí dụ về giao diện bổ trợ của LibreOffice Calc.

Hàm phân tích Phần 1

Hàm phân tích Phần 2

DAYSINMONTH

Tính số ngày của tháng chứa ngày tháng đã nhập.

Syntax

DAYSINMONTH(Ngày)

Ngày là bất cứ ngày tháng nào trong tháng tương ứng của năm đã muốn. Tham số Ngày phải là một ngày tháng hợp lệ tùy theo thiết lập miền địa phương của LibreOffice.

Example

=DAYSINMONTH(A1) trả về 29 ngày nếu ô A1 chứa 1968-02-17, một ngày tháng hợp lệ trong tháng 2, năm 1968.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.DAYSINMONTH

tip

DAYSINYEAR

Tính số ngày của năm trong đó ngày đã nhập có xảy ra.

Syntax

DAYSINYEAR(Ngày)

Ngày là bất cứ ngày tháng nào trong năm tương ứng. Tham số Ngày phải là một ngày tháng hợp lệ tùy theo thiết lập miền địa phương của LibreOffice.

Example

=DAYSINYEAR(A1) trả về 366 ngày nếu ô A1 chứa 1968-02-29, một ngày tháng hợp lệ trong năm 1968.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.DAYSINYEAR

tip

ISLEAPYEAR

Quyết định nếu một năm là năm nhuận không. Có thì hàm trả về 1 (Đúng), không thì 0 (Sai).

Syntax

ISLEAPYEAR("Ngày")

Date specifies whether a given date falls within a leap year. The Date parameter must be a valid date.

warning

Microsoft Excel wrongly assumes year 1900 to be a leap year and considers the inexistent day of 1900-02-29 as valid in date calculations. Dates prior to 1900-03-01 are therefore different in Excel and Calc.


Example

=ISLEAPYEAR(A1) trả về 1, nếu ô A1 chứa 1968-02-29, ngày tháng hợp lệ ngày 29, tháng 2/1968 tùy theo thiết lập miền địa phương của bạn.

You may also use =ISLEAPYEAR(DATE(1968;2;29)) or =ISLEAPYEAR("1968-02-29") giving the date string in the ISO 8601 notation.

Không bao giờ nên dùng « =ISLEAPYEAR(2/29/68) », vì nó sẽ trước tiên tính 2 chia cho 2 chia cho 68, sau đó tính hàm ISLEAPYEAR từ số nhỏ này dưới dạng một số ngày tháng dãy.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.ISLEAPYEAR

tip

MONTHS

Tính hiệu số theo tháng giữa hai ngày tháng.

Syntax

MONTHS(Ngày_đầu; Ngày_cuối; Kiểu)

Ngày_đầu là ngày tháng thứ nhất

Ngày_cuối là ngày tháng thứ hai

Kiểu ngụ ý kiểu hiệu số. Giá trị có thể là 0 (khoảng thời gian) và 1 (tháng theo lịch).

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.MONTHS

tip

ROT13

Mã hoá một chuỗi các ký tự bằng cách dời mỗi ký tự theo 12 vị trí trong bảng chữ cái. Phía sau chữ Z, bảng chữ cái bắt đầu lại (xoay lại). Bằng cách áp dụng hàm mã hoá lần nữa với mã kết quả, bạn cũng có thể giải mã văn bản đó.

Syntax

ROT13(Chuỗi)

Chuỗi là chuỗi các ký tự cần mã hoá. « ROT13(ROT13(Chuỗi)) » thì giải mã chuỗi đã mã hoá.

Example

=ROT13("Gur Qbphzrag Sbhaqngvba jnf sbhaqrq va Frcgrzore 2010.") returns the string "The Document Foundation was founded in September 2010.". Notice how spaces, digits, and full stops are unaffected by ROT13.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.ROT13

tip

Refer to the ROT13 wiki page for more details about this function.


WEEKS

Tính hiệu số theo tuần giữa hai ngày tháng.

Syntax

WEEKS(Ngày_đầu; Ngày_cuối; Kiểu)

StartDate is the start date in the interval.

EndDate is the end date in the interval. The end date must be greater than the start date, or else an error is returned.

Type specifies the type of difference to be calculated. Possible values are 0 (time interval) or 1 (calendar weeks).

If Type = 0 the function will assume that 7 days is equivalent to one week without considering any specific day to mark the beginning of a week.

If Type = 1 the function will consider Monday to be the first day of the week. Therefore, except for the start date, each occurrence of a Monday in the interval is counted as an additional week.

note

This function considers Monday to be the first day of the week regardless of the current locale settings.


Example

In the following examples, dates are passed as strings. However, they can also be stored in separate cells and be passed as references.

=WEEKS("01/12/2022","01/17/2022",0) returns 0 because Type was set to 0 and there are only 5 days in the interval.

=WEEKS("01/12/2022","01/19/2022",0) returns 1 because Type was set to 0 and there are 7 days in the interval.

=WEEKS("01/12/2022","01/17/2022",1) returns 1 because Type was set to 1 and the interval contains a Monday, since 01/12/2022 is a Wednesday and 01/17/2022 is a Monday.

=WEEKS("01/10/2022","01/15/2022",1) returns 0 because Type was set to 1 and the interval does not contain any Mondays, except for the start date.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.WEEKS

tip

WEEKSINYEAR

Tính số tuần trong năm chứa ngày tháng đã nhập. Số tuần được xác định như theo đây: một tuần qua từ năm này đến năm sau thì được thêm vào năm chứa nhiều ngày nhất của tuần đó.

Syntax

WEEKSINYEAR(Ngày)

Ngày là bất cứ ngày tháng nào trong năm tương ứng. Tham số Ngày phải là một ngày tháng hợp lệ tùy theo thiết lập miền địa phương của LibreOffice.

Example

WEEKSINYEAR(A1) trả về 53 nếu ô A1 chứa 1970-02-17, một ngày tháng hợp lệ trong năm 1970.

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.WEEKSINYEAR

tip

YEARS

Tính hiệu số theo năm giữa hai ngày tháng.

Syntax

YEARS(Ngày_đầu; Ngày_cuối; Kiểu)

Ngày_đầu là ngày tháng thứ nhất

Ngày_cuối là ngày tháng thứ hai

Kiểu ngụ ý kiểu hiệu số. Giá trị có thể là 0 (khoảng thời gian) và 1 (năm theo lịch).

Technical information

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

ORG.OPENOFFICE.YEARS

tip

Phần bổ trợ qua giao diện API của LibreOffice

Add-ins can also be implemented through the LibreOffice API.

Please support us!