excelcol - Excel column name by index

excelcol provides a convenient way for Stata programmers to write loops and obtain Excel column name by it's index.

A summary of limits imposed by different electronic spreadsheets is available here.

Installation

Stata 9.2 or newer is required for this command. excelcol is available from SSC. To install it, type in Stata
  findit excelcol

and follow the links to install the module.

Syntax and use

There are two versions of the program: in Stata and in Mata. Both produce identical results. In fact Stata version simply calls Mata internally. Stata version of the command is implemented as an r-class command and saves the result into the macro column.

To call the mata version, write in Mata:

  colname=ExcelColumn(#)

To call the Stata version, write in Stata:

  excelcol #
  local colname `r(column)'

The result in both cases is a string.

For example:

  mata
    colname=ExcelColumn(512)
    colname
  end

About

excelcol was written by Sergiy Radyakin, Economist, The World Bank.