New to Telerik Document ProcessingStart a free 30-day trial

Name Converter

Updated on Jul 15, 2026

The NameConverter is a static class that provides methods for name conversion (for example, converting cell names to indexes and vice versa).

Methods

The following table lists the available methods:

MethodDescription
ConvertRowIndexToNameConverts the row index to a name.
ConvertRowNameToIndexConverts the row name to an index.
ConvertColumnIndexToNameConverts the column index to a name.
ConvertColumnNameToIndexConverts the column name to an index.
ConvertCellIndexToNameConverts the cell index to a name.
TryConvertNamesToCellReferenceRangeExpressionTries to convert the cell range names to cell reference ranges.
ConvertCellReferenceToNameConverts the cell reference to a name.
ConvertCellRangeToNameConverts the cell range to a name.
TryConvertNameToCellRangeTries to convert the name to a cell range.
ConvertCellIndexesToNameConverts the cell indexes to a name.
ConvertCellNameToIndexConverts the cell name to a cell index.
TryConvertCellNameToIndexTries to convert the cell name to an index.
IsValidA1CellNameDetermines whether the name of the cell is valid.

Convert Row Index to Name

The ConvertRowIndexToName method converts the row index to a name.

Example 1: Convert row index 0 to its worksheet row name

C#
int rowIndex = 0;
string rowName = NameConverter.ConvertRowIndexToName(rowIndex);

Convert Row Name to Index

The ConvertRowNameToIndex method converts the row name to an index.

Example 2: Convert row name 1 to its zero-based row index

C#
string rowName = "1";
int rowIndex = NameConverter.ConvertRowNameToIndex(rowName);

Convert Column Index to Name

The ConvertColumnIndexToName method converts the column index to a name.

Example 3: Convert column index 0 to its worksheet column name

C#
int columnIndex = 0;
string columnName = NameConverter.ConvertColumnIndexToName(columnIndex);

Convert Column Name to Index

The ConvertColumnNameToIndex method converts the column name to an index.

Example 4: Convert column name A to its zero-based column index

C#
string columnName = "A";
int columnIndex = NameConverter.ConvertColumnNameToIndex(columnName);

Convert Cell Index to Name

The ConvertCellIndexToName method converts the cell index to a name. This method exposes two overloads.

Example 5: Convert a CellIndex for row 0, column 0 to cell name A1

C#
CellIndex cellIndex = new CellIndex(rowIndex: 0, columnIndex: 0);
string cellName = NameConverter.ConvertCellIndexToName(cellIndex);

Example 6: Convert row 0 and column 0 directly to cell name A1

C#
string cellName = NameConverter.ConvertCellIndexToName(rowIndex: 0, columnIndex: 0);

Try Convert Names to Cell Reference Range Expression

The TryConvertNamesToCellReferenceRangeExpression method tries to convert the cell range names to cell reference ranges.

Example 7: Convert the range name A1:F11 to a CellReferenceRangeExpression

C#
string cellRangesName = "A1:F11";
Worksheet worksheet = workbook.ActiveWorksheet;
int rowIndex = 0;
int columnIndex = 0;
CellReferenceRangeExpression cellReferenceRangeExpression;
bool isConversionToCellReferenceRangeExpressionSuccessful = NameConverter.TryConvertNamesToCellReferenceRangeExpression(cellRangesName, worksheet, rowIndex, columnIndex, out cellReferenceRangeExpression);

Convert Cell Reference to Name

The ConvertCellReferenceToName method converts the cell reference to a name.

Example 8: Convert the from and to cell references from a range expression back to names

C#
CellReference fromCellReference = cellReferenceRangeExpression.CellReferenceRange.FromCellReference;
string fromCellReferenceName = NameConverter.ConvertCellReferenceToName(fromCellReference);

CellReference toCellReference = cellReferenceRangeExpression.CellReferenceRange.ToCellReference;
string toCellReferenceName = NameConverter.ConvertCellReferenceToName(toCellReference);

Convert Cell Range to Name

The ConvertCellRangeToName method converts the cell range to a name.

Example 9: Convert two CellIndex values into the range name A1:F11

C#
CellIndex fromIndex = new CellIndex(rowIndex: 0, columnIndex: 0);
CellIndex toIndex = new CellIndex(rowIndex: 10, columnIndex: 5);
string cellRangeName = NameConverter.ConvertCellRangeToName(fromIndex, toIndex);

Try Convert Name to Cell Range

The TryConvertNameToCellRange method converts the name to a cell range.

Example 10: Convert the range name A1:F11 back to a CellRange

C#
CellIndex fromIndex = new CellIndex(rowIndex: 0, columnIndex: 0);
CellIndex toIndex = new CellIndex(rowIndex: 10, columnIndex: 5);
string cellRangeName = NameConverter.ConvertCellRangeToName(fromIndex, toIndex);

CellRange cellRange;
bool result = NameConverter.TryConvertCellRangeNameToCellRange(cellRangeName, out cellRange);

Convert Cell Indexes to Name

The ConvertCellIndexesToName method converts the cell indexes to a name.

Example 11: Convert four cell indexes directly into the range name A1:F11

C#
string cellRangeName = NameConverter.ConvertCellIndexesToName(fromRowIndex: 0, fromColumnIndex: 0, toRowIndex: 10, toColumnIndex: 5);

Convert Cell Name to Index

The ConvertCellNameToIndex method converts the cell name to a cell index. This method exposes two overloads.

Example 12: Convert cell name A1 to row and column indexes

C#
string cellName = "A1";
int rowIndex;
int columnIndex;
NameConverter.ConvertCellNameToIndex(cellName, out rowIndex, out columnIndex);

Example 13: Convert cell name A1 and capture absolute row and column flags

C#
string cellName = "A1";
int rowIndex;
bool isRowAbsolute;
int columnIndex;
bool isColumnAbsolute;
NameConverter.ConvertCellNameToIndex(cellName, out isRowAbsolute, out rowIndex, out isColumnAbsolute, out columnIndex);

Try Convert Cell Name to Index

The TryConvertCellNameToIndex method tries to convert the cell name to an index. This method exposes two overloads.

Example 14: Try to convert cell name A1 to row and column indexes

C#
string cellName = "A1";
int rowIndex;
int columnIndex;
bool isConversionSuccessful = NameConverter.TryConvertCellNameToIndex(cellName, out rowIndex, out columnIndex);

Example 15: Try to convert cell name A1 and capture absolute row and column flags

C#
string cellName = "A1";
int rowIndex;
bool isRowAbsolute;
int columnIndex;
bool isColumnAbsolute;
bool isConversionSuccessful = NameConverter.TryConvertCellNameToIndex(cellName, out isRowAbsolute, out rowIndex, out isColumnAbsolute, out columnIndex);

Is Valid A1 Cell Name

The IsValidA1CellName method determines whether the name of the cell is valid.

Example 16: Check whether B2 is a valid A1-style cell name

C#
string cellName = "B2";
bool isValidCellName = NameConverter.IsValidA1CellName(cellName);

See Also