text - Required. The text string to extract characters from.
num_chars - Optional. Number of characters to extract from the right. Defaults to 1 if omitted.
| A | B | |
|---|---|---|
| 1 | Text | Result |
| 2 | Hello World | |
| 3 | report.xlsx | |
| 4 | Formula: | =RIGHT(A2, 5) World |
Example: A1="Hello World"
=RIGHT("Hello World", 5) → "World"
Example: A1="document.xlsx"
=RIGHT("document.xlsx", 5) → "xlsx"
Example: A1="John Smith"
=RIGHT("John Smith", 5) → "Smith"
Example: A1="1234567890123456"
="****-****-****-"&RIGHT(..., 4) → "****-****-****-3456"
Parse product SKU numbers from barcodes or item identifiers. Retail operations, inventory management systems, and e-commerce platforms use the RIGHT function in Excel to automatically extract product codes from long barcodes. This RIGHT formula pattern is essential for warehouse management, order fulfillment automation, and product tracking systems where barcodes contain multiple pieces of information and you need to isolate the product identifier for database lookups and inventory control.
| A | B | C | |
|---|---|---|---|
| 1 | Barcode | Product | SKU |
| 2 | Complete | SKU-2024-001-ABC123 | |
| 3 | Formula: | =RIGHT(A2, 6) ABC123 |
Automatically extract file extensions (.pdf, .xlsx, .docx) from full file paths for document classification and validation. Document management systems, file processing workflows, and data entry operations frequently use the Excel RIGHT function to parse extensions from file names for automated sorting, type validation, and file handling rules. This RIGHT formula pattern enables data quality checks, automated report routing, and compliance tracking systems where file type validation is critical for business processes.
| A | B | C | |
|---|---|---|---|
| 1 | Filename | Path | Extension |
| 2 | Document | report-2024-final.xlsx | |
| 3 | Formula: | =RIGHT(A2, LEN(A2)-FIND(".", A2)) xlsx |
❌ The Problem:
✅ Solution:
=RIGHT(A1, 5)Always specify the number of characters to extract. If omitted, defaults to 1.
❌ The Problem:
✅ Solution:
=RIGHT(A1, MIN(10, LEN(A1)))Use MIN with LEN to safely extract up to num_chars without exceeding text length.
❌ The Problem:
✅ Solution:
=IF(num_chars>0, RIGHT(A1, num_chars), "")Validate that num_chars is positive before using RIGHT to avoid silent failures.
Master these RIGHT Function variants:
From basics to advanced - AI generates perfect formulas instantly.