MS Excel: How To Use The RIGHT Function (WS, VBA) - TechOnTheNet

TechOnTheNet Logo
  1. Home
  2. MS Excel
  3. Formulas / Functions
totn Excel Functions MS Excel: How to use the RIGHT Function (WS, VBA)

This Excel tutorial explains how to use the Excel RIGHT function with syntax and examples.

Description

The Microsoft Excel RIGHT function extracts a substring from a string starting from the right-most character.

The RIGHT function is a built-in function in Excel that is categorized as a String/Text Function. It can be used as a worksheet function (WS) and a VBA function (VBA) in Excel. As a worksheet function, the RIGHT function can be entered as part of a formula in a cell of a worksheet. As a VBA function, you can use this function in macro code that is entered through the Microsoft Visual Basic Editor.

Syntax

The syntax for the RIGHT function in Microsoft Excel is:

RIGHT( text, [number_of_characters] )

Parameters or Arguments

text The string that you wish to extract from. number_of_characters Optional. It indicates the number of characters that you wish to extract starting from the right-most character. If this parameter is omitted, only 1 character is returned.

Returns

The RIGHT function returns a string/text value.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)
  • VBA function (VBA)

Example (as Worksheet Function)

Let's look at some Excel RIGHT function examples and explore how to use the RIGHT function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the Excel spreadsheet above, the following RIGHT examples would return:

=RIGHT(A1, 4) Result: "soup" =RIGHT("techonthenet", 6) Result: "thenet" =RIGHT(A2, 6) Result: "et.com" =RIGHT("Excel", 3) Result: "cel" =RIGHT("Microsoft") Result: "t"

Example (as VBA Function)

The RIGHT function can also be used in VBA code in Microsoft Excel.

Let's look at some Excel RIGHT function examples and explore how to use the RIGHT function in Excel VBA code:

Dim LResult As String LResult = Right("Alphabet",3)

The variable LResult would now contain the value of "bet".

Share on:

Databases

  • SQL
  • Oracle / PLSQL
  • SQL Server
  • MySQL
  • MariaDB
  • PostgreSQL
  • SQLite

MS Office

  • Excel
  • Access
  • Word

Web Development

  • HTML
  • CSS
  • JavaScript
  • Color Picker

Programming

  • C Language

More

  • ASCII
  • Unicode
  • Linux
  • UNIX
  • Techie Humor
clear filter right caret

Lookup/Ref Functions

  • ADDRESS (WS)
  • AREAS (WS)
  • CHOOSE (WS, VBA)
  • COLUMN (WS)
  • COLUMNS (WS)
  • HLOOKUP (WS)
  • HYPERLINK (WS)
  • INDEX (WS)
  • INDIRECT (WS)
  • LOOKUP (WS)
  • MATCH (WS)
  • OFFSET (WS)
  • ROW (WS)
  • ROWS (WS)
  • TRANSPOSE (WS)
  • VLOOKUP (WS)
  • XLOOKUP (WS)
down caret

String/Text Functions

  • ASC (VBA)
  • BAHTTEXT (WS)
  • CHAR (WS)
  • CHR (VBA)
  • CLEAN (WS)
  • CODE (WS)
  • CONCAT (WS)
  • CONCATENATE (WS)
  • CONCATENATE with & (WS, VBA)
  • DOLLAR (WS)
  • EXACT (WS)
  • FIND (WS)
  • FIXED (WS)
  • FORMAT STRINGS (VBA)
  • INSTR (VBA)
  • INSTRREV (VBA)
  • LCASE (VBA)
  • LEFT (WS, VBA)
  • LEN (WS, VBA)
  • LOWER (WS)
  • LTRIM (VBA)
  • MID (WS, VBA)
  • NUMBERVALUE (WS)
  • PROPER (WS)
  • REPLACE (WS)
  • REPLACE (VBA)
  • REPT (WS)
  • RIGHT (WS, VBA)
  • RTRIM (VBA)
  • SEARCH (WS)
  • SPACE (VBA)
  • SPLIT (VBA)
  • STR (VBA)
  • STRCOMP (VBA)
  • STRCONV (VBA)
  • STRREVERSE (VBA)
  • SUBSTITUTE (WS)
  • T (WS)
  • TEXT (WS)
  • TEXTJOIN (WS)
  • TRIM (WS, VBA)
  • UCASE (VBA)
  • UNICHAR (WS)
  • UNICODE (WS)
  • UPPER (WS)
  • VAL (VBA)
  • VALUE (WS)
right caret

Date/Time Functions

  • DATE (WS)
  • DATE (VBA)
  • DATEADD (VBA)
  • DATEDIF (WS)
  • DATEDIFF (VBA)
  • DATEPART (VBA)
  • DATESERIAL (VBA)
  • DATEVALUE (WS, VBA)
  • DAY (WS, VBA)
  • DAYS (WS)
  • DAYS360 (WS)
  • EDATE (WS)
  • EOMONTH (WS)
  • FORMAT DATES (VBA)
  • HOUR (WS, VBA)
  • ISOWEEKNUM (WS)
  • MINUTE (WS, VBA)
  • MONTH (WS, VBA)
  • MONTHNAME (VBA)
  • NETWORKDAYS (WS)
  • NETWORKDAYS.INTL (WS)
  • NOW (WS, VBA)
  • SECOND (WS)
  • TIME (WS)
  • TIMESERIAL (VBA)
  • TIMEVALUE (WS, VBA)
  • TODAY (WS)
  • WEEKDAY (WS, VBA)
  • WEEKDAYNAME (VBA)
  • WEEKNUM (WS)
  • WORKDAY (WS)
  • WORKDAY.INTL (WS)
  • YEAR (WS, VBA)
  • YEARFRAC (WS)
right caret

Math/Trig Functions

  • ABS (WS, VBA)
  • ACOS (WS)
  • ACOSH (WS)
  • AGGREGATE (WS)
  • ASIN (WS)
  • ASINH (WS)
  • ATAN (WS)
  • ATAN2 (WS)
  • ATANH (WS)
  • ATN (VBA)
  • CEILING (WS)
  • CEILING.PRECISE (WS)
  • COMBIN (WS)
  • COMBINA (WS)
  • COS (WS, VBA)
  • COSH (WS)
  • DEGREES (WS)
  • EVEN (WS)
  • EXP (WS, VBA)
  • FACT (WS)
  • FIX (VBA)
  • FLOOR (WS)
  • FORMAT NUMBERS (VBA)
  • INT (WS, VBA)
  • LN (WS)
  • LOG (WS)
  • LOG (VBA)
  • LOG10 (WS)
  • MDETERM (WS)
  • MINVERSE (WS)
  • MMULT (WS)
  • MOD (WS)
  • MOD (VBA)
  • ODD (WS)
  • PI (WS)
  • POWER (WS)
  • PRODUCT (WS)
  • RADIANS (WS)
  • RAND (WS)
  • RANDBETWEEN (WS)
  • RANDOMIZE (VBA)
  • RND (VBA)
  • ROMAN (WS)
  • ROUND (WS)
  • ROUND (VBA)
  • ROUNDDOWN (WS)
  • ROUNDUP (WS)
  • SGN (VBA)
  • SIGN (WS)
  • SIN (WS, VBA)
  • SINH (WS)
  • SQR (VBA)
  • SQRT (WS)
  • SUBTOTAL (WS)
  • SUM (WS)
  • SUMIF (WS)
  • SUMIFS (WS)
  • SUMPRODUCT (WS)
  • SUMSQ (WS)
  • SUMX2MY2 (WS)
  • SUMX2PY2 (WS)
  • SUMXMY2 (WS)
  • TAN (WS, VBA)
  • TANH (WS)
  • TRUNC (WS)
right caret

Statistical Functions

  • AVEDEV (WS)
  • AVERAGE (WS)
  • AVERAGEA (WS)
  • AVERAGEIF (WS)
  • AVERAGEIFS (WS)
  • BETA.DIST (WS)
  • BETA.INV (WS)
  • BETADIST (WS)
  • BETAINV (WS)
  • BINOM.DIST (WS)
  • BINOM.INV (WS)
  • BINOMDIST (WS)
  • CHIDIST (WS)
  • CHIINV (WS)
  • CHITEST (WS)
  • COUNT (WS)
  • COUNTA (WS)
  • COUNTBLANK (WS)
  • COUNTIF (WS)
  • COUNTIFS (WS)
  • COVAR (WS)
  • FORECAST (WS)
  • FREQUENCY (WS)
  • GROWTH (WS)
  • INTERCEPT (WS)
  • LARGE (WS)
  • LINEST (WS)
  • MAX (WS)
  • MAXA (WS)
  • MAXIFS (WS)
  • MEDIAN (WS)
  • MIN (WS)
  • MINA (WS)
  • MINIFS (WS)
  • MODE (WS)
  • MODE.MULT (WS)
  • MODE.SNGL (WS)
  • PERCENTILE (WS)
  • PERCENTRANK (WS)
  • PERMUT (WS)
  • QUARTILE (WS)
  • RANK (WS)
  • SLOPE (WS)
  • SMALL (WS)
  • STDEV (WS)
  • STDEVA (WS)
  • STDEVP (WS)
  • STDEVPA (WS)
  • VAR (WS)
  • VARA (WS)
  • VARP (WS)
  • VARPA (WS)
right caret

Logical Functions

  • AND (WS)
  • AND (VBA)
  • CASE (VBA)
  • FALSE (WS)
  • FOR...NEXT (VBA)
  • IF (WS)
  • IF (more than 7) (WS)
  • IF (up to 7) (WS)
  • IF-THEN-ELSE (VBA)
  • IFERROR (WS)
  • IFNA (WS)
  • IFS (WS)
  • NOT (WS)
  • OR (WS)
  • OR (VBA)
  • SWITCH (WS)
  • SWITCH (VBA)
  • TRUE (WS)
  • WHILE...WEND (VBA)
right caret

Information Functions

  • CELL (WS)
  • ENVIRON (VBA)
  • ERROR.TYPE (WS)
  • INFO (WS)
  • ISBLANK (WS)
  • ISDATE (VBA)
  • ISEMPTY (VBA)
  • ISERR (WS)
  • ISERROR (WS, VBA)
  • ISLOGICAL (WS)
  • ISNA (WS)
  • ISNONTEXT (WS)
  • ISNULL (VBA)
  • ISNUMBER (WS)
  • ISNUMERIC (VBA)
  • ISREF (WS)
  • ISTEXT (WS)
  • N (WS)
  • NA (WS)
  • TYPE (WS)
right caret

Financial Functions

  • ACCRINT (WS)
  • ACCRINTM (WS)
  • AMORDEGRC (WS)
  • AMORLINC (WS)
  • DB (WS)
  • DDB (WS, VBA)
  • FV (WS, VBA)
  • IPMT (WS, VBA)
  • IRR (WS, VBA)
  • ISPMT (WS)
  • MIRR (WS, VBA)
  • NPER (WS, VBA)
  • NPV (WS, VBA)
  • PMT (WS, VBA)
  • PPMT (WS, VBA)
  • PV (WS, VBA)
  • RATE (WS, VBA)
  • SLN (WS, VBA)
  • SYD (WS, VBA)
  • VDB (WS)
  • XIRR (WS)
right caret

Database Functions

  • DAVERAGE (WS)
  • DCOUNT (WS)
  • DCOUNTA (WS)
  • DGET (WS)
  • DMAX (WS)
  • DMIN (WS)
  • DPRODUCT (WS)
  • DSTDEV (WS)
  • DSTDEVP (WS)
  • DSUM (WS)
  • DVAR (WS)
  • DVARP (WS)
right caret

Engineering Functions

  • BIN2DEC (WS)
  • BIN2HEX (WS)
  • BIN2OCT (WS)
  • COMPLEX (WS)
  • CONVERT (WS)
right caret

File/Directory Functions

  • CHDIR (VBA)
  • CHDRIVE (VBA)
  • CURDIR (VBA)
  • DIR (VBA)
  • FILEDATETIME (VBA)
  • FILELEN (VBA)
  • GETATTR (VBA)
  • MKDIR (VBA)
  • SETATTR (VBA)
right caret

Data Type Conv. Functions

  • CBOOL (VBA)
  • CBYTE (VBA)
  • CCUR (VBA)
  • CDATE (VBA)
  • CDBL (VBA)
  • CDEC (VBA)
  • CINT (VBA)
  • CLNG (VBA)
  • CSNG (VBA)
  • CSTR (VBA)
  • CVAR (VBA)

Home | About Us | Contact Us | Testimonials | Donate

While using this site, you agree to have read and accepted our Terms of Service and Privacy Policy.

Copyright © 2003-2026 TechOnTheNet.com. All rights reserved.

Tag » Code Vba Droite