web-apps/apps/spreadsheeteditor/main/resources/help/en/Functions/cell.htm

188 lines
7.7 KiB
HTML
Raw Normal View History

2020-09-14 12:21:50 +00:00
<!DOCTYPE html>
<html>
<head>
<title>CELL Function</title>
<meta charset="utf-8" />
<meta name="description" content="" />
<link type="text/css" rel="stylesheet" href="../editor.css" />
<script type="text/javascript" src="../callback.js"></script>
<script type="text/javascript" src="../search/js/page-search.js"></script>
</head>
<body>
<div class="mainpart">
<div class="search-field">
<input id="search" class="searchBar" placeholder="Search" type="text" onkeypress="doSearch(event)">
</div>
<h1>CELL Function</h1>
<p>The <b>CELL</b> function is one of the information functions. It is used to return information about the formatting, location, or contents of a cell.</p>
<p>The <b>CELL</b> function syntax is:</p>
<p style="text-indent: 150px;"><b><em>CELL(info_type, [reference])</em></b></p>
<p>where:</p>
<p style="text-indent: 50px;"><b><em>info_type</em></b> is a text value that specifies which information about the cell you want to get. This is the required argument. The available values are listed in the table below.</p>
2020-10-01 12:19:50 +00:00
<p style="text-indent: 50px;"><b><em>[reference]</em></b> is a cell that you want to get information about. If it is omitted, the information is returned for the last changed cell. If the <em>reference</em> argument is specified as a range of cells, the function returns the information for the upper-left cell of the range.</p>
2020-09-14 12:21:50 +00:00
<table style="width: 40%">
<tr>
<td><b>Text value</b></td>
2020-10-01 12:19:50 +00:00
<td><b>Type of information</b></td>
2020-09-14 12:21:50 +00:00
</tr>
<tr>
<td>"address"</td>
<td>Returns the reference to the cell.</td>
</tr>
<tr>
<td>"col"</td>
<td>Returns the column number where the cell is located.</td>
</tr>
<tr>
<td>"color"</td>
<td>Returns 1 if the cell is formatted in color for negative values; otherwise returns 0.</td>
</tr>
<tr>
<td>"contents"</td>
<td>Returns the value that the cell contains.</td>
</tr>
<tr>
<td>"filename"</td>
<td>Returns the filename of the file that contains the cell.</td>
</tr>
<tr>
<td>"format"</td>
<td>Returns a text value corresponding to the number format of the cell. The text values are listed in the table below.</td>
</tr>
<tr>
<td>"parentheses"</td>
<td>Returns 1 if the cell is formatted with parentheses for positive or all values; otherwise returns 0.</td>
</tr>
<tr>
<td>"prefix"</td>
2020-10-01 12:19:50 +00:00
<td>Returns the single quotation mark (') if the text in the cell is left-aligned, the double quotation mark (") if the text is right-aligned, the caret (^) if the text is centered, <!--the backslash (\) if the text is fill-aligned,-->and an empty text ("") if the cell contains anything else.</td>
2020-09-14 12:21:50 +00:00
</tr>
<tr>
<td>"protect"</td>
<td>Returns 0 if the cell is not locked; returns 1 if the cell is locked.</td>
</tr>
<tr>
<td>"row"</td>
<td>Returns the row number where the cell is located.</td>
</tr>
<tr>
<td>"type"</td>
<td>Returns "b" for an empty cell, "l" for a text value, and "v" for any other value in the cell.</td>
</tr>
<tr>
<td>"width"</td>
<td>Returns the width of the cell, rounded off to an integer.</td>
</tr>
</table>
<p>Below you can see the text values which the function returns for the <em>"format"</em> argument</p>
<table style="width: 40%">
<tr>
<td><b>Number format</b></td>
<td><b>Returned text value</b></td>
</tr>
<tr>
<td>General</td>
<td>G</td>
</tr>
<tr>
<td>0</td>
<td>F0</td>
</tr>
<tr>
<td>#,##0</td>
<td>,0</td>
</tr>
<tr>
<td>0.00</td>
<td>F2</td>
</tr>
<tr>
<td>#,##0.00</td>
<td>,2</td>
</tr>
<tr>
<td>$#,##0_);($#,##0)</td>
<td>C0</td>
</tr>
<tr>
<td>$#,##0_);[Red]($#,##0)</td>
<td>C0-</td>
</tr>
<tr>
<td>$#,##0.00_);($#,##0.00)</td>
<td>C2</td>
</tr>
<tr>
<td>$#,##0.00_);[Red]($#,##0.00)</td>
<td>C2-</td>
</tr>
<tr>
<td>0%</td>
<td>P0</td>
</tr>
<tr>
<td>0.00%</td>
<td>P2</td>
</tr>
<tr>
<td>0.00E+00</td>
<td>S2</td>
</tr>
<tr>
<td># ?/? or # ??/??</td>
<td>G</td>
</tr>
<tr>
<td>m/d/yy or m/d/yy h:mm or mm/dd/yy</td>
<td>D4</td>
</tr>
<tr>
<td>d-mmm-yy or dd-mmm-yy</td>
<td>D1</td>
</tr>
<tr>
<td>d-mmm or dd-mmm</td>
<td>D2</td>
</tr>
<tr>
<td>mmm-yy</td>
<td>D3</td>
</tr>
<tr>
<td>mm/dd</td>
<td>D5</td>
</tr>
<tr>
<td>h:mm AM/PM</td>
<td>D7</td>
</tr>
<tr>
<td>h:mm:ss AM/PM</td>
<td>D6</td>
</tr>
<tr>
<td>h:mm</td>
<td>D9</td>
</tr>
<tr>
<td>h:mm:ss</td>
<td>D8</td>
</tr>
</table>
<p>To apply the <b>CELL</b> function,</p>
<ol>
<li>select the cell where you wish to display the result,</li>
<li>click the <b>Insert function</b> <img alt="Insert function icon" src="../images/insertfunction.png" /> icon situated at the top toolbar,
<br />or right-click within a selected cell and select the <b>Insert Function</b> option from the menu,
<br />or click the <img alt="Function icon" src="../images/function.png" /> icon situated at the formula bar,
</li>
<li>select the <b>Information</b> function group from the list,</li>
<li>click the <b>CELL</b> function,</li>
<li>enter the required argument,</li>
<li>press the <b>Enter</b> button.</li>
</ol>
<p>The result will be displayed in the selected cell.</p>
<p style="text-indent: 150px;"><img alt="CELL Function" src="../images/cell.png" /></p>
</div>
</body>
</html>