COS Function in ONLYOFFICE Spreadsheet Editor: Angles, Syntax, and Examples
Calculate the cosine of angles in ONLYOFFICE, convert degrees to radians, reproduce a validation worksheet, and avoid floating-point pitfalls.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
Quick answer
=COS(0) has independently expected result 1, while =ROUND(COS(RADIANS(60)),6) has expected result 0.5. All results here are mathematical expectations independently calculated, not results observed in an ONLYOFFICE installation.
What COS does and when to use it
Cosine maps an angle to the horizontal coordinate of the unit circle: in real mathematics its value stays between −1 and 1. Radians are the mathematical convention used in the examples; the short official COS argument text says only “numeric value” and does not explicitly specify degrees versus radians.
Typical applications include spreadsheet diagrams, engineering classroom exercises, geometry models and numerical cross-checks. COS is bounded by −1 and 1 in exact mathematics; small floating-point residuals near zero are not automatically bugs.
Exact documented syntax, argument order and defaults
=COS(number)
| Argument position | Name | Required? | Documented type, units and limits | Default |
|---|---|---|---|---|
| 1 | number |
Yes | A numeric value or numeric formula/cell reference representing an angle; example calculations use radians, without claiming the short COS article explicitly documents the unit. | None — the official article documents no optional arguments. |
The name, spelling, one-argument order and the specific documented domain/unit details above come from the official ONLYOFFICE COS reference, checked 2026-10-13 UTC. A cell reference such as COS(A2) is ordinary formula usage. Coercion of arbitrary strings, blank cells, error values, and exact handling of floating-point underflow/overflow are not fully specified in the short vendor article and are not asserted here.
Version, edition and regional settings
The COS function reference was checked on 2026-10-13 (UTC); it is a function-level English-language help article without a first-supported-version matrix. The function is documented for ONLYOFFICE Spreadsheet Editor, but that alone does not prove identical behaviour in every web Docs, desktop, offline or self-hosted release. The official Docs changelog and Desktop Editors changelog are separate; neither establishes the earliest build supporting the precise formula from the references checked here. No native Desktop or web execution was available in this run.
The official function insertion guide describes typing a formula or choosing Home / Formula → Insert Function, and notes the Shift+F3 shortcut. The Advanced Settings reference documents independent Formula Language, Region, and decimal/thousands separator settings. The examples below use English names, decimal periods, and commas between ROUND arguments. Check the actual editor’s formula language and syntax suggestions when moving formulas across locales; localized aliases and separators have not been native-tested. In a one-argument COS(...) call, there is no function-argument separator inside the call.
Cross-product compatibility: this guide shows the official ONLYOFFICE English syntax only. Other spreadsheet products may have similarly named functions; their runtime error coercion, locale, precision, and version support are not evidence for ONLYOFFICE. A file exported between products requires an explicit test in each destination environment. No claim of exact compatibility is made here.
Step-by-step: a reusable test worksheet
- Open a blank workbook. In
A1, typeInput (number or formula), inB1typeCOS result, and inC1typeRounded check. - Copy the input expressions in the A column shown below. If an input starts with
=, enter it as a formula (rather than text); a bare numeric entry is typed as a number. Do not enter Markdown backticks. - In
B2enter=COS(A2); inC2enter=ROUND(B2,6)in English-language formula notation. - Fill B2:C2 downward through row 13. The row-specific formulas below show what filling down should produce.
- Compare column C against the independently calculated results. Differences require checking the release, language, input units, and rounding. No native execution or screenshots are claimed.
| Cell A | Formula in B | Formula in C | Expected result displayed in C |
|---|---|---|---|
A2: 0 |
=COS(A2) |
=ROUND(B2,6) |
1 |
A3: =PI()/6 |
=COS(A3) |
=ROUND(B3,6) |
0.866025 |
A4: =PI()/4 |
=COS(A4) |
=ROUND(B4,6) |
0.707107 |
A5: =PI()/3 |
=COS(A5) |
=ROUND(B5,6) |
0.5 |
A6: =PI()/2 |
=COS(A6) |
=ROUND(B6,6) |
0 |
A7: =PI() |
=COS(A7) |
=ROUND(B7,6) |
-1 |
A8: =3*PI()/2 |
=COS(A8) |
=ROUND(B8,6) |
0 |
A9: =2*PI() |
=COS(A9) |
=ROUND(B9,6) |
1 |
A10: =RADIANS(60) |
=COS(A10) |
=ROUND(B10,6) |
0.5 |
A11: 1 |
=COS(A11) |
=ROUND(B11,6) |
0.540302 |
A12: 60 |
=COS(A12) |
=ROUND(B12,6) |
-0.952413 |
A13: =-PI()/3 |
=COS(A13) |
=ROUND(B13,6) |
0.5 |
Validation method: Python math functions independently calculated each raw expected number and then prepared a six-decimal display value. Tiny floating-point differences are possible; the six-decimal display is an editorial expectation, not a promised bitwise result for every installation.
Additional worked formulas and practical cases
Each expression below is independent; enter it into an empty cell. The ROUND(...,6) wrapper makes comparisons readable in the English-language reference syntax. The listed outputs are calculated results, not screenshots or native application observations.
| Application | Enter in any empty cell | Expected 6-decimal display |
|---|---|---|
| A circle’s horizontal coordinate | =ROUND(12*COS(RADIANS(60)),6) |
6 |
| Slope cosine at 30 degrees | =ROUND(COS(RADIANS(30)),6) |
0.866025 |
| Opposite angles agree | =ROUND(COS(RADIANS(-60)),6) |
0.5 |
| A cosine wave at a quarter turn | =ROUND(5+2*COS(PI()/2),6) |
5 |
| Pythagorean identity with sine | =ROUND(SIN(RADIANS(30))^2+COS(RADIANS(30))^2,6) |
1 |
| Cosine difference of nearby angles | =ROUND(COS(RADIANS(60))-COS(RADIANS(30)),6) |
-0.366025 |
Advanced applications
Construct a simple horizontal-motion model
Suppose the radius is in D2 (12) and the angle in degrees is in E2 (60). Enter =D2*COS(RADIANS(E2)) in F2; the independent expected horizontal displacement is 6. Change E2 to 120; the expected displacement is −6. This is a coordinate component, not a distance traveled. For the vertical component use =D2*SIN(RADIANS(E2)) and use a sign convention appropriate for the worksheet.
Use a circular-identity check rather than an exact comparison
Enter =ROUND(SIN(RADIANS(30))^2+COS(RADIANS(30))^2,10) in an empty cell. Independently expected 1. For two measured components x and y, =SQRT(x^2+y^2) recovers their approximate magnitude, but check the same release and numerical precision before treating the identity as a native-test guarantee.
Avoid degree and unit mistakes
=COS(60) treats the literal as the bare numeric argument in standard radian trigonometry; this is not the usual cosine of 60 degrees. Use =COS(RADIANS(60)) for a degree-based source. Likewise, =COS(PI()) may be displayed as −1 while a value expected to be zero at a quarter-turn may actually be a tiny floating-point number. Round for reporting, not to mask an input-unit error.
Limits, errors and troubleshooting
- Wrong angle unit: A column of
30,60, or90normally means degrees in real-world measurements. Convert it with the officially documentedRADIANSfunction before calling COS. - Tiny residual instead of zero: The mathematical cosine of 90° is exactly zero; finite-precision PI and trigonometric evaluation can yield a small nonzero number. Use
ROUNDor a numerical tolerance rather than=COS(PI()/2)=0as a reliability test. - Text, blanks, booleans, and error cells: The official COS help article does not document all coercion/error cases. Do not promise a particular
#VALUE!or other error in ONLYOFFICE without testing the target release. - Formula not recognized or punctuation differs: Confirm Formula Language, regional decimal separator, and whether the pasted expression begins with
=. - Version/platform discrepancy: Recheck release changelogs and run the same test fixture in web and Desktop; results in a different spreadsheet app do not validate ONLYOFFICE.
Related functions and verified documentation links
- COS — official ONLYOFFICE function reference (syntax, one argument and vendor-described purpose).
- RADIANS — convert degree angles to radians and DEGREES — convert radian angles to degrees (vendor-documented converter directions and syntax).
- PI — mathematical constant (vendor-documented zero-argument function).
- SIN — sine reference, COS — cosine reference, TAN — tangent reference, and ACOS — arccosine reference (mathematically related operations; only the linked vendor claims are asserted).
- Inserting functions and Advanced Settings (editor steps and formula language/region settings).
- Docs changelog and Desktop Editors changelog (separate release tracks; not proof of uniform compatibility).
Official references were checked on 2026-10-13 UTC; they establish documented syntax, not native execution of the examples.
Verification limitations
All outputs are independent mathematical expectations. Native ONLYOFFICE Desktop/web execution, exact runtime errors, localized parsing, historical release support and workbook interchange remain untested.