스프레드시트 함수

이 섹션은 예제와 함께 스프레드시트 함수에 대한 설명을 담고 있습니다.

이 명령을 사용하려면...

삽입 - 함수 - 범주 스프레드시트


[text/scalc/01/func_error_type.xhp#error_type_head not found].

Returns a number representing a specific Error type, or the error value #N/A, if there is no error.

STYLE

Applies a style to the cell containing the formula.

ADDRESS

지정한 행 번호와 열 번호에 따라 셀 주소(참조)를 텍스트로 반환합니다. 주소를 절대 주소(예: $A$1), 상대 주소(예: A1) 또는 혼합 형태(예: A$1 또는 $A1) 중에서 어떤 유형으로 인식할지를 지정할 수 있습니다. 시트 이름을 지정할 수도 있습니다.

상호 운용성을 위해, ADDRESS 와 INDIRECT 함수는 일반적인 A1 표기 대신 R1C1 주소 표기를 사용해서 지정하는지에 대한 추가적인 매개 변수를 지원합니다.

ADDRESS 에서는, 임의의 시트 이름 매개 변수를 다섯번째로 옮기면서, 매개 변수는 네번째로 삽입됩니다.

INDIRECT 에서는, 매개 변수는 두번째 매개 변수로 추가됩니다.

두개 모두의 함수에서, 인자가 0 값으로 삽입되면, R1C1 표기가 쓰여집니다. 만약 인자가 주어지지 않거나 0 이 아닌 다른 값이면, A1 표기가 쓰여집니다.

R1C1 표기의 경우, ADDRESS 는 시트 이름 구분자로서 느낌표 '!' 를 사용하는 주소 문자열을 반환하고, INDIRECT 는 느낌표를 시트 이름 구분자로 사용합니다. 그리고 두 함수 모두 마침표 '.' 를 A1 표기처럼 시트 이름 구분자로 사용합니다.

When opening documents from ODF 1.0/1.1 format, the ADDRESS functions that show a sheet name as the fourth parameter will shift that sheet name to become the fifth parameter. A new fourth parameter with the value 1 will be inserted.

ODF 1.0/1.1 형식으로 문서를 저장할 때, 만약 ADDRESS 함수가 네번째 매개 변수를 가지고 있으면, 이 매개 변수는 제거됩니다.

note

ADDRESS 함수의 새로운 네번째 매개 변수가 0 의 값을 가진다면, 예전의 ODF 1.0/1.1 형식으로 스프레드시트를 저장하지 마십시오.


note

ODF 1.0/1.1 형식에서 INDIRECT 함수는 변환없이 저장됩니다. 두번째 매개 변수가 존재하면, 예전 버전의 Calc 는 오류를 반환합니다.


구문

ADDRESS(Row; Column [; Abs [; A1 [; "Sheet"]]])

은 셀 참조 영역의 행 번호를 의미합니다.

은 참조할 열 번호를 나타내며, 알파벳이 아닌 열의 순서대로 번호를 붙여 사용합니다.

Abs는 참조의 종류를 지정합니다.

1: 절대($A$1)

2: 행, 절대적; 열, 상대적 (A$1)

3: 행, 상대적; 열, 절대적 ($A1)

4: 상대적 (A1)

A1이 0이면 R1C1 표기를 사용합니다. 매개 변수가 없거나 0이 아닌 다른 값이면, A1 표기를 사용합니다 (선택 사항)

시트는 시트의 이름을 말합니다. 항상 겹따옴표("")로 싸여있어야 합니다.

=ADDRESS(1;1;2;"Sheet2")는 Sheet2.A$1을 반환합니다.

If the formula above is in cell B2 of current sheet, and the cell A1 in sheet 2 contains the value -6, you can refer indirectly to the referenced cell using a function in B2 by entering =ABS(INDIRECT(B2)). The result is the absolute value of the cell reference specified in B2, which in this case is 6.

AREAS

다중 범위에 속하는 개별 범위의 수를 구합니다. 범위는 인접한 셀 또는 단일 셀로 구성될 수 있습니다.

이 함수는 단일 개요 예외가 있습니다, 다수 범위를 두었을 때에는 반드시 사이에 삽입 어구를 넣어야 합니다. 다수 범위는 분리 기호로 세미콜론(;)을 넣을 수 있지만, 자동으로 물결 표시(~)로 변환하게 됩니다. 물결 표시는 범위를 잇는 데 사용됩니다.

구문

AREAS(참조)

참조는 셀이나 셀 영역에 대한 참조입니다.

예제

=AREAS((A1:B3;F2;G1))는 세 셀 및 영역을 참조하므로 3을 반환합니다. 이후에 들어간 부분은 =AREAS((A1:B3~F2~G1))로 변환됩니다.

만일 데이터 - 범위 정의 메뉴에서 All이라는 이름의 영역을 지정했다면 =AREAS(All) 함수는 1을 반환합니다.

CHOOSE

색인을 사용하여 최대 30개의 값 목록에서 값을 구합니다.

구문

CHOOSE(Index; Value 1 [; Value 2 [; ... [; Value 30]]])

1과 30 사이의 수 또는 참조인 인덱스는 목록에서 어떤 값을 선택할지 지정합니다.

Value 1, Value 2, ..., Value 30 is the list of values entered as a reference to a cell or as individual values.

예제

=CHOOSE(A1;B1;B2;B3;"오늘";"어제";"내일")을 입력한다고 가정하면 A1이 2일 경우 결과값은 B2 셀의 값이 되고 A1 셀의 값이 4일 경우는 문자열 "오늘"이 됩니다.

COLUMN

Returns the column number of a cell reference. If the reference is a cell the column number of the cell is returned; if the parameter is a cell area, the corresponding column numbers are returned in a single-row array if the formula is entered as an array formula. If the COLUMN function with an area reference parameter is not used for an array formula, only the column number of the first cell within the area is determined.

구문

COLUMN([Reference])

참조는 열 번호를 구해야 하는 하나의 셀 또는 셀 영역에 대한 참조입니다.

참조가 지정되지 않으면, 수식이 입력되는 셀의 열 번호가 산출됩니다. LibreOffice Calc는 자동으로 현재 셀에 대한 참조를 설정합니다.

예제

=COLUMN(A1)는 1과 같습니다. A열은 표의 첫번째 열입니다.

=COLUMN(C3:E3)은 3과 같습니다. C열은 표에서 세 번째 열입니다.

D 열은 표에서 네번째 열이고 COLUMN 함수를 배열 함수로 사용할 수 없기 때문에 =COLUMN(D3:G10)는 4를 반환합니다. (이 상황에서는 배열의 첫 값이 항상 결과로 사용됩니다.)

{=COLUMN(B2:B7)}=COLUMN(B2:B7)은 참조가 테이블에서 두번째 열인 B 열만 포함하기 때문에 2 를 반환합니다. 단일 열 영역은 열 번호가 하나 뿐이므로 배열 함수를 이용하지 않으면 차이를 볼 수 없습니다.

만일 C 열에 =COLUMN()를 입력한다면 이 함수는 3을 결과로 반환할 것입니다.

C1:D3 영역의 이름이 "Rabbit"으로 지정되어 있을 경우 {=COLUMN(Rabbit)}는 단일행 배열 (3, 4)를 반환합니다.

COLUMNS

주어진 참조의 열 수를 구합니다.

구문

COLUMNS(배열)

배열은 찾을 열의 총 수를 가진 셀 범위에 대한 참조입니다. 인수로 한 개의 셀을 사용할 수도 있습니다.

예제

셀이 한 열에 걸쳐 지정되어 있으므로 =COLUMNS(B5)은 1을 반환합니다.

=COLUMNS(A1:C5)는 3과 같습니다. 세 열을 참조합니다.

=COLUMNS(Rabbit)Rabbit이 (C1:D3) 영역에 있을 경우 2를 반환합니다.

DDE

DDE 기반 링크의 결과를 구합니다. 연결된 범위나 구역의 내용이 변경되면 구해진 값도 변경됩니다. 업데이트된 링크를 보려면 스프레드시트를 다시 로드하거나 편집 - 링크를 선택해야 합니다. 상호 플랫폼 링크(예: Windows 시스템에서 실행 중인 LibreOffice 설치에서 Linux 시스템에서 작성한 문서로의 링크)는 허용되지 않습니다.

구문

DDE("Server"; "File"; "Range" [; Mode])

Server is the name of a server application. LibreOffice applications have the server name "soffice".

파일은 올바른 경로가 있는 파일의 이름입니다.

영역는 데이터를 읽어들일 범위입니다.

Mode는 DDE 서버의 데이터를 숫자로 변환하는 방법을 지정하는 선택 사항 매개 변수입니다.

모드

작용

0 또는 없음

"표준" 셀 유형의 숫자 서식

1

데이터는 항상 미국식 영어의 표준 서식으로 해석됩니다

2

데이터는 텍스트로 적용되며 숫자로 바뀌지 않습니다


예제

=DDE("soffice";"c:\office\document\data1.ods";"sheet1.A1") reads the contents of cell A1 in sheet1 of the LibreOffice Calc spreadsheet data1.ods.

=DDE("soffice";"c:\office\document\motto.odt";"Today's motto") returns a motto in the cell containing this formula. First, you must enter a line in the motto.odt document containing the motto text and define it as the first line of a section named Today's Motto (in LibreOffice Writer under Insert - Section). If the motto is modified (and saved) in the LibreOffice Writer document, the motto is updated in all LibreOffice Calc cells in which this DDE link is defined.

ERRORTYPE

다른 셀에서 발생한 오류 값에 해당하는 숫자를 구합니다. 이 숫자를 사용하여 오류 메시지 텍스트를 생성할 수 있습니다.

오류가 발생하면 논리 값이나 숫자 값이 반환됩니다.

note

오류가 포함된 셀을 클릭하면 상태 표시줄은 LibreOffice의 미리 정의된 오류 코드를 표시합니다.


구문

ERRORTYPE(참조)

참조는 오류가 발생한 셀의 주소를 포함합니다.

예제

만일 A1 셀이 Err:518 에러 메시지를 출력한다면 =ERRORTYPE(A1) 함수로 정수 518의 값을 돌려받을 수 있습니다.

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.ERRORTYPE

GETPIVOTDATA

The GETPIVOTDATA 함수는 DataPilot 테이블로부터 결과값을 반환합니다. 이 값은 필드와 아이템 이름을 써서 정해지므로, DataPilot 테이블의 레이아웃이 변했을 경우에도 여전히 유효합니다.

구문

두 개의 서로 다른 구문 정의를 사용할 수 있음:

GETPIVOTDATA(TargetField; pivot table[; Field 1; Item 1][; ... [Field 126; Item 126]])

or

GETPIVOTDATA(데이터 파일럿; 제약)

두 번째 구문은 정확하게 두 개의 매개 변수가 지정된 경우 첫 번째 매개 변수는 셀 또는 셀 영역 참조라고 가정합니다. 첫 번째 구문은 모든 다른 경우를 가정합니다. 이 함수 마법사는 첫 번째 구문을 보여줍니다.

First Syntax

대상필드는 데이터파일럿 테이블의 데이터 필드 중 하나를 선택하는 문자열입니다. 문자열은 원본열의 이름이거나 테이블에 있는 데이터 필드명도 가능합니다.(예: "합계 - 판매").

데이터 파일럿은 데이터 파일럿 테이블에 위치하거나 데이터 파일럿 테이블을 포함하는 셀 또는 셀 범위의 참조입니다. 만약 셀 범위가 다수의 데이터 파일럿 테이블을 포함하고 있으면, 마지막에 생성된 테이블이 사용됩니다.

If no 필드 n / 항목 n의 쌍이 부여되고, 전체 합계가 반환되었습니다. 그렇지 않으면, 각각의 쌍은 결과를 만족시켜야 하는 제약을 추가합니다. 필드 n 은(는) 데이터 파일럿 테이블로부터의 필드명입니다. 항목 n 은(는) 그 필드로부터의 한 항목명입니다.

만약 데이터 파일럿 테이블이 모든 제약을 만족하는 단일 결과값 또는 모든 일치하는 값을 요약하는 소계만을 포함하고 있다면, 그 결과가 반환됩니다. 만약 일치하는 결과가 없거나, 소계없이 결과가 많으면 오류가 반환됩니다. 이러한 조건은 데이터 파일럿 테이블에 포함된 결과에 적용됩니다.

만약 원본 데이터가 데이터 파일럿의 설정에 의해 숨겨진 항목을 포함하고 있으면, 이는 무시됩니다. 필드/항목 쌍의 순서는 유효하지 않습니다. 필드 및 항목의 이름은 대/소문자를 구별하지 않습니다.

If no constraint for a filter is given, the field's selected value is implicitly used. If a constraint for a filter is given, it must match the field's selected value, or an error is returned. Filters are the fields at the top left of a pivot table, populated using the "Filters" area of the pivot table layout dialog. From each filter, an item (value) can be selected, which means only that item is included in the calculation.

DataPilot 테이블로부터 나온 소계값은 이 값이 "자동" 함수를 썼을 경우에만 쓰입니다.(제약 조건이 지정되었을 때에는 예외로, 아래 Second Syntax를 참조합니다).

Second Syntax

데이터 파일럿은 첫 번째 구문과 같은 의미를 가집니다.

제약은 공백으로 분리된 목록입니다. 항목은 따옴표로 묶을 수 있습니다(작은 따옴표). 모든 문자열은 다른 셀로부터 문자열이 참조되지 않는 한 따옴표로 묶어야 합니다(큰 따옴표).

엔트리 가운데 하나는 데이터 필드 이름일 수 있습니다. 이 데이터 필드 이름은 DataPilot 테이블이 데이터 필드를 단 하나만 포함하고 있을 때에는 무시될 수 있으며, 그밖에 경우에는 존재해야 합니다.

각각의 다른 항목은 필드[Item] 양식으로 제약을 지정합니다 (상수 문자 [ ] 사용). 항목 이름이 데이터 파일럿 테이블에서 사용 중인 모든 필드에서 고유할 경우 항목을 항목 만으로 할 수 있습니다.

필드[항목;함수] 양식에서 함수명을 추가할 수 있습니다. 이럴 경우 그 함수를 사용한 부분합 값하고만 일치하는 제한 조건이 생깁니다. 여기에 사용할 수 있는 함수는 Sum, Count, Average, Max, Min, Product, Count(숫자만), StDev(표본), StDevP(집단), Var(표본), VarP(집단) 등이며, 대소문자를 구별하지 않습니다.

HLOOKUP

선택한 영역 아래의 셀에 대한 참조와 값을 검색합니다. 이 함수는 배열의 첫 번째 행에 특정 값이 포함되어 있는지 확인합니다. 그런 다음 이 함수는 동일한 열의 색인에서 명명된 배열 행의 값을 구합니다.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every regular expression metacharacter or operator with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in - LibreOffice Calc - Calculate.

warning

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".


구문

HLOOKUP(Lookup; Array; Index [; SortedRangeLookup])

For an explanation on the parameters, see: VLOOKUP (columns and rows are exchanged)

빈 셀 처리

예제

Suppose we have built a small database table occupying the cell range A1:DO4 and containing basic information about 118 chemical elements. The first column contains the row headings “Element”, “Symbol”, “Atomic Number”, and “Relative Atomic Mass”. Subsequent columns contain the relevant information for each of the elements, ordered left to right by atomic number. For example, cells B1:B4 contain “Hydrogen”, “H”, “1” and “1.008”, while cells DO1:DO4 contain “Oganesson”, “Og”, “118”, and “294”.

A

B

C

D

...

DO

1

요소

Hydrogen

Helium

Lithium

...

Oganesson

2

기호

H

He

Li

...

Og

3

Atomic Number

1

2

3

...

118

4

Relative Atomic Mass

1.008

4.0026

6.94

...

294


=HLOOKUP("Lead"; $A$1:$DO$4; 2; 0) returns “Pb”, the symbol for lead.

=HLOOKUP("Gold"; $A$1:$DO$4; 3; 0) returns 79, the atomic number for gold.

=HLOOKUP("Carbon"; $A$1:$DO$4; 4; 0) returns 12.011, the relative atomic mass of carbon.

HYPERLINK

HYPERLINK 함수가 포함된 셀을 클릭하면 하이퍼링크가 열립니다.

If you use the optional CellValue parameter, the formula locates the URL, and then displays the text or number.

tip

키보드를 사용하여 하이퍼링크 셀을 열려면, 셀을 선택하고 F2 키를 눌러 편집 모드로 들어갑니다. 그런 다음 하이퍼링크의 맨 앞으로 커서를 이동하고 Shift + F10 을 누른 다음 하이퍼링크 열기를 선택합니다.


구문

HYPERLINK("URL" [; CellValue])

URL specifies the link target. The optional CellValue parameter is the text or a number that is displayed in the cell and will be returned as the result. If the CellValue parameter is not specified, the URL is displayed in the cell text and will be returned as the result.

빈 셀과 행렬 원소는 숫자 0을 반환합니다.

예제

=HYPERLINK("http://www.example.org") displays the text "http://www.example.org" in the cell and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK("http://www.example.org";"Click here") displays the text "Click here" in the cell and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK("http://www.example.org";12345) displays the number 12345 and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK($B4) where cell B4 contains http://www.example.org. The function adds http://www.example.org to the URL of the hyperlink cell and returns the same text which is used as formula result.

=HYPERLINK("http://www.";"Click ") & "example.org" displays the text Click example.org in the cell and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK("#Sheet1.A1";"Go to top") displays the text Go to top and jumps to cell Sheet1.A1 in this document.

=HYPERLINK("file:///C:/writer.odt#Specification";"Go to Writer bookmark") displays the text "Go to Writer bookmark", loads the specified text document and jumps to bookmark "Specification".

=HYPERLINK("file:///C:/Documents/";"Open Documents folder") displays the text "Open Documents folder" and shows the folder contents using the standard file manager in your operating system.

tip

The function tries to bridge with system specificities. For example, "c:\path to\file.ext" will be properly interpreted as "file:///c:/path%20to/file.ext" on Windows, or ".." will lead to the parent directory of the document.


INDEX

INDEX returns a reference, a value or an array of values from a reference range, specified by row and column index number or array of row and array of columns index numbers, and an optional range index.

INDEX() returns a reference if the argument is one or more references. When used in a cell in the form =INDEX(), the reference is resolved and the values displayed. When INDEX() is used in arguments of other functions, =FUNCTION(INDEX()...), the function gets the reference passed that was returned by INDEX(). Returning a reference is different from returning an array of values for functions that handles them differently.

구문

INDEX(Reference [; [Row] [; [Column] [; Range]]])

Reference is a reference, entered either directly or by specifying a range name. If the reference consists of multiple ranges, you must enclose the list of references or range names in parentheses, or either use the tilde (~) range concatenation operator or define a named range with multiple areas.

Row (optional) represents the row or the array of row indexes of the reference range, for which to return a value. In case of zero or omitted (no specific row) all referenced rows are returned.

Column (optional) represents the column or array of column indexes of the reference range, for which to return a value. In case of zero or omitted (no specific column) all referenced columns are returned.

note

If Row, Column or both are omitted or defined as arrays of indexes, the INDEX function must be entered as an array function.


Range (optional) represents the index of the subrange if referring to a multiple range, default is 1.

예제

{=INDEX({1,3,5;7,9,10},{2;1},1)} return a 2 row array containing 7 and 1. The row index {2;1} pick row 2 then row 1. The columns index 1 picks the first column.

{=INDEX(D3:G12,{1;2;3;4},{3,1})} return a 4 rows by 2 columns array. The row index array {1;2;3;4} picks rows 3 to 6 and {3;1} picks the third (F) and first column (D). Columns 1 and 3 of the source reference are swapped in the resulting array.

=INDEX(Prices;4;1)데이터 - 정의에서 Prices이라고 정의한 데이터베이스 범위에서 4 개의 행과 1 개의 열에 있는 값을 반환합니다.

=INDEX(SumX;4;1) returns the value from the range SumX in row 4 and column 1 as defined in Sheet - Named Ranges and Expressions - Define.

{=INDEX(A1:B6;1)} returns the values of the first row of A1:B6. Enter the formula as an array formula.

{=INDEX(A1:B6;0;1)} returns the values of the first column of A1:B6. Enter the formula as an array formula.

=INDEX(A1:B6;1;1)는 A1:B6 범위에서 위에서부터 첫번째, 왼쪽에서 첫번째의 셀을 의미합니다.

{=INDEX((A1:B6;C1:D6);0;0;2)} returns the values of the second range C1:D6 of the multiple range. Enter the formula as an array formula.

INDIRECT

텍스트 문자열에 지정된 참조를 구합니다. 또한 이 함수를 사용하여 해당 문자열의 영역을 구할 수 있습니다.

This function is always recalculated whenever a recalculation occurs.

상호 운용성을 위해, ADDRESS 와 INDIRECT 함수는 일반적인 A1 표기 대신 R1C1 주소 표기를 사용해서 지정하는지에 대한 추가적인 매개 변수를 지원합니다.

ADDRESS 에서는, 임의의 시트 이름 매개 변수를 다섯번째로 옮기면서, 매개 변수는 네번째로 삽입됩니다.

INDIRECT 에서는, 매개 변수는 두번째 매개 변수로 추가됩니다.

두개 모두의 함수에서, 인자가 0 값으로 삽입되면, R1C1 표기가 쓰여집니다. 만약 인자가 주어지지 않거나 0 이 아닌 다른 값이면, A1 표기가 쓰여집니다.

R1C1 표기의 경우, ADDRESS 는 시트 이름 구분자로서 느낌표 '!' 를 사용하는 주소 문자열을 반환하고, INDIRECT 는 느낌표를 시트 이름 구분자로 사용합니다. 그리고 두 함수 모두 마침표 '.' 를 A1 표기처럼 시트 이름 구분자로 사용합니다.

When opening documents from ODF 1.0/1.1 format, the ADDRESS functions that show a sheet name as the fourth parameter will shift that sheet name to become the fifth parameter. A new fourth parameter with the value 1 will be inserted.

ODF 1.0/1.1 형식으로 문서를 저장할 때, 만약 ADDRESS 함수가 네번째 매개 변수를 가지고 있으면, 이 매개 변수는 제거됩니다.

note

ADDRESS 함수의 새로운 네번째 매개 변수가 0 의 값을 가진다면, 예전의 ODF 1.0/1.1 형식으로 스프레드시트를 저장하지 마십시오.


note

ODF 1.0/1.1 형식에서 INDIRECT 함수는 변환없이 저장됩니다. 두번째 매개 변수가 존재하면, 예전 버전의 Calc 는 오류를 반환합니다.


구문

INDIRECT(Ref [; A1])

참조는 내용을 반환하기 위한 셀이나 영역(텍스트 폼)의 참조 범위입니다.

A1이 0이면 R1C1 표기를 사용합니다. 매개 변수가 없거나 0이 아닌 다른 값이면, A1 표기를 사용합니다 (선택 사항)

note

If you open an Excel spreadsheet that uses indirect addresses calculated from string functions, the sheet addresses will not be translated automatically. For example, the Excel address in INDIRECT("[filename]sheetname!"&B1) is not converted into the Calc address in INDIRECT("filename#sheetname."&B1).


예제

만일 A1 셀의 값이 C108이고 C108 셀의 값이 100일 경우 =INDIRECT(A1)의 결과값은 100이 됩니다.

=SUM(INDIRECT("a1:" & ADDRESS(1;3)))은 A1셀부터 ADDRESS함수에 지정된 부분, 즉 1행 3열의 셀까지를 합산합니다. 다시말하면 A1:C1 범위의 셀 값이 합산되는 것입니다.

LOOKUP