Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

Accessing a spreadsheet by column instead of name after importing from Excel

Experts,

I was wondering if there is a way to access a column  in Excel by column (i.e. Column A) in lieu of the column heading in SAS.  This would allow flexibility of bypassing column headings which may be long or descriptive in Excel but not good for a SAS variable name.
Avatar of ckluka
ckluka

You are looking for the "indirect" function.

http://office.microsoft.com/en-gb/excel-help/indirect-HP005209139.aspx


You can address a cell (B3) for example two ways:

=indirect(B3,TRUE)
=indirect(R3C2,FALSE)

You can replace "B3" or "R3C2" with a string literal or cell reference so you can use it in a formula or function to iterate through a list or entire column.
Avatar of morinia

ASKER

ckluka,
I would like to reference the column in SAS.
ASKER CERTIFIED SOLUTION
Avatar of Aloysius Low
Aloysius Low
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial