RIGHT Function in ONLYOFFICE Spreadsheet Editor: Syntax and Worked Examples

Text and Data Beginner ONLYOFFICE Spreadsheet Editor

Return the last specified characters in text while preserving text-only suffixes.

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

RIGHT function in ONLYOFFICE Spreadsheet Editor

Quick answer: RIGHT returns the last n characters of a text string. It is useful for extracting the 1047 at the end of the identifier CA-ON-1047.

Extract fixed-length serial numbers, trailing status flags and suffixes without splitting the original column. This is a guide to ONLYOFFICE specifically: the formula syntax below is supported by its own official help page, while the example outputs are independently reasoned expected results.

Official syntax and argument definitions

=RIGHT(text, [num_chars])
Argument Required? Definition In the worksheet
text Required Text value or cell containing the text. A3
num_chars Optional Number of characters taken from the right, at least zero; defaults to 1 when omitted. 4

The official RIGHT reference supplies the function name, argument order and definitions. text can be supplied through a source cell or a literal text value in quotation marks. If you see [num_chars] in the function signature for LEFT or RIGHT, brackets mark optional syntax rather than literal brackets to type. The MID and LEN references list no optional arguments.

Version, edition, platform and formula-entry notes

The function is present in the current official ONLYOFFICE Spreadsheet Editor function catalogue and has a dedicated unversioned help page. These sources describe the current Docs/web-help function, not the first supported release. The reviewed Docs changelog and Desktop Editors changelog do not establish a first release, identical behavior in every desktop/web version, or implementation in the mobile app for this function. First-supported version: not verified. If the function is absent in your installed version, consult the matching product/version documentation rather than relying on this guide for guaranteed support. No native desktop, web, or mobile test was performed.

The official function insertion instructions specify a leading =, parentheses, double quotes around literal text, and commas between arguments for the English help examples. Brackets in printed syntax signify an optional argument; do not type them. The regional settings guide documents formula-language settings and decimal/thousands separators. It does not conclusively establish the argument separator for every locale; for a localized installation, check the syntax displayed in its own Function Arguments dialog. Avoid claiming that a semicolon always works without testing your chosen locale.

Follow along: sample worksheet

Open a blank spreadsheet in ONLYOFFICE Spreadsheet Editor. Enter the following values in column A, starting with the header in A1. Set the code cells to text before import or typing if your source might otherwise auto-convert identifiers. These codes have exactly two hyphens except the deliberately malformed A7.

Cell Value typed as text Interpretation in this exercise
A1 Code Header, not part of the formulas
A2 CA-ON-1047 Country CA, region ON, serial 1047
A3 US-NY-0052 Country US, region NY, serial 0052
A4 CA-BC-0318 Country CA, region BC, serial 0318
A5 CA-ON-1048 Country CA, region ON, serial 1048
A6 US-CA-2004 Country US, region CA, serial 2004
A7 BADCODE Deliberately missing the two hyphens

Keep your results in free cells, such as C2:C10, not in column A. If a formula contains a quoted text value, keep the quotation marks. Copying the same row references from this table makes it possible to check each step independently.

The expected outputs on this page come from string positions and independent checks, not from any run of ONLYOFFICE.

Step-by-step basic examples

In C2 enter:

=RIGHT(A2,4)

Expected C2: 1047. The four rightmost characters are the serial. Now enter =RIGHT(A3,4) in C3: expected 0052. As a text extraction, the leading zero is part of the returned string; avoid converting the result to a number if those zeros matter. The last four characters of A4 are 0318.

Defaults and boundaries: =RIGHT(A2) is expected to return 7, and =RIGHT(A2,0) is expected to yield empty text (""). The function’s official parameter definition supplies default 1 and requires a nonnegative count. These examples assume the worksheet’s A-column values are stored as text.

Advanced application

Get everything after the second hyphen even if the final segment length varies. In D2 enter:

=RIGHT(A2,LEN(A2)-FIND("-",A2,FIND("-",A2)+1))

Expected D2: 1047. The first FIND locates the first hyphen at character 3, the nested FIND locates the second at position 6, LEN returns 10, and RIGHT takes 10−6=4 characters. For A3, expected 0052, preserving the leading zeros. The FIND official reference documents its optional start position; LEN has its own reference. This handles a suffix that is not known to be four characters but requires two hyphens.

To keep an invalid value from producing an unexplained error, in D7 use:

=IFERROR(RIGHT(A7,LEN(A7)-FIND("-",A7,FIND("-",A7)+1)),"Check code")

Expected D7: Check code because the first hyphen is missing and FIND returns #VALUE!. This is a convenience fallback, not a formal identifier validator.

Common errors, edge cases and limitations

  • RIGHT counts characters, not the numeric value of a trailing string. 0052 must remain text if the initial zeros are meaningful.
  • If the source contains trailing spaces, spaces will be included in the suffix; inspect imported strings before assuming a clean serial.
  • A negative count is outside the official parameter range; the exact error label was not executed or observed here.
  • A variable-length ending means RIGHT(A2,4) is not enough: use the documented LEN and FIND combination or a tested parser.
  • The official page groups RIGHT and RIGHTB. Its byte-oriented RIGHTB notes do not mean that ordinary RIGHT is measured in bytes. Non-ASCII behavior was not tested.

Troubleshooting checklist

  1. Check your actual source cell. Compare A2 with the sample character by character; ensure it is stored as text, not imported as a number/date with a changed display.
  2. Confirm the argument order. Use ONLYOFFICE’s function wizard to enter each argument; a comma-delimited example assumes the English reference settings.
  3. Inspect separators and spaces. The two-hyphen examples rely on exactly CA-ON-1047-style codes. Import cleanup is an independent step, not something RIGHT automatically does.
  4. Test simple formulas before nesting. Verify the one-function result, then test FIND, LEN, SUBSTITUTE, AND, or IFERROR components separately where used.
  5. Verify your product build. If the formula name is not recognized, confirm the edition, application version and formula language; unversioned online help is not proof of support in every older or mobile build.
  6. Avoid masking errors. Do not accept an IFERROR fallback as proof an identifier is valid; inspect the row that failed.

Cross-spreadsheet compatibility: what is and is not established

Microsoft Excel RIGHT uses the same basic arguments, including optional num_chars=1; the fixed ASCII suffix examples have the same independently derived result. Excel identifies RIGHTB as deprecated, while ONLYOFFICE still lists a RIGHTB reference. Treat this as a product difference in documentation, not proof of identical Unicode behavior or edition availability. Formula delimiter settings, cell typing and text/byte interpretation may differ. These examples were not imported into Microsoft Excel, Google Sheets or LibreOffice; any simple-portability statement is limited to official syntax and manually verified ASCII text.

Official reference and verification

Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in ONLYOFFICE Spreadsheet Editor.

  • No genuine ONLYOFFICE Spreadsheet Editor screenshots are included; this guide does not use mock application images.