Function Repository Resource:

PositionToSpreadsheetIndex

Source Notebook

Convert Wolfram positions to spreadsheet coordinates

Contributed by: Sjoerd Smit

ResourceFunction["PositionToSpreadsheetIndex"][{row,col}]

converts a position pair to a spreadsheet cell reference such as B3.

ResourceFunction["PositionToSpreadsheetIndex"][col]

converts integer col to a spreadsheet column letter.

Details

Rows and columns are reversed when converting a Wolfram Language position to a spreadsheet index.

Examples

Basic Examples (1) 

Convert a Position tuple to a spreadsheet coordinate:

In[1]:=
ResourceFunction["PositionToSpreadsheetIndex"][{2, 1}]
Out[1]=
In[2]:=
ResourceFunction["PositionToSpreadsheetIndex"][{1, 28}]
Out[2]=

Scope (1) 

If only a single integer is given, it will be converted to the corresponding column designation:

In[3]:=
ResourceFunction["PositionToSpreadsheetIndex"][100]
Out[3]=

Properties and Relations (1) 

The resource function SpreadsheetIndexToPosition is the inverse of PositionToSpreadsheetIndex:

In[4]:=
ResourceFunction["PositionToSpreadsheetIndex"]@
 ResourceFunction["SpreadsheetIndexToPosition"][
  "AA3"
  ]
Out[4]=
In[5]:=
ResourceFunction["SpreadsheetIndexToPosition"]@
 ResourceFunction["PositionToSpreadsheetIndex"][
  {10, 33}
  ]
Out[5]=

Publisher

Sjoerd Smit

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 06 May 2024

Related Resources

License Information