Excel to Analytica Mappings/Information Functions

< Excel to Analytica Mappings
Revision as of 20:23, 16 March 2016 by Bbecane (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


CELL(info_type, cell)

In Excel, this is used to access various internal aspects of a cell. There is no exact equivalent, but several analogues in Analytica do apply.

Many of the info_type settings involve accessing aspects of the number format for the cell. In Analytica, you can examine the number format of a variable «X» using:

NumberFormat Of X

When this is null, it means that the default number format is being used (e.g., Suffix 4).

Other «info_type»s are loosely analogous to other attributes of Analytica objects, such as NodeSize, etc.

ERROR.TYPE(error_val)

This is very specific to Excel. There is no Analytica equivalent.

However, note that in Analytica, to test for NaN, use IsNaN(x). To test for Null, use x==Null.

INFO(type_text)

Analytica equivalents for INFO("directory"):

CurrentModelFolder()
CurrentDataFolder()

Analytica equivalent for INFO("system"):

AnalyticaPlatform

(Excel would return "pcdos". Analytica's system variable will be "Windows")

Analytica equivalent for INFO("release"):

AnalyticaVersion

(Returns an integer such as 40601 to indicate release 4.6.1).

ISBLANK

ISERR

ISERROR

ISEVEN(x)

Analytica equivalent:

Mod(x, 2)==0

ISLOGICAL(x)

Analytica equivalent:

(x==0 or x==1)

ISNA

ISNONTEXT(x)

Analytica equivalent:

Not IsText(x)

ISNUMBER(x)

Analytica equivalent:

IsNumber(x)

ISODD(x)

Analytica equivalent:

Mod(x, 2)==1

ISREF(x)

Analytica equivalent:

IsRef(x)

Note: This tests whether «x» is an Analytica reference.

ISTEXT(x)

Analytica equivalent:

IsText(x)

N(val)

Analytica equivalent:

If IsNumber(val) Then val Else 0

NA

NA is used in Excel to mark cells as empty, so you don't unintentionally include empty cells in your calculations without knowing it. The same can be accomplished by using blank cells in Analytica edit tables.

By default, Analytica will initialize edit table cells to 0. To change this behavior to use blank cells instead, press F12 to enter the typescript window and type:

Sys_TableCellDefault :

Note the colon with nothing after it (i.e., blank is after it). This will cause edit table cells to appear as blank, and a warning will occur if you attempt to use a table containing blank cells in a computation. From an edit table with blank as a default cell value, you can clear a cell, returning it to the blank state, just by erasing its contents.

TYPE(x)

Analytica equivalent:

TypeOf(x)

This is not an exact equivalent since the return values are somewhat different. When «x» is numberic, Excel returns 1, TypeOf(x) is "Number". For text, Excel returns 2, Analytica's TypeOf(x) returns "Text". Also, Analytica applies this cell-by-cell, array abstracting across an array. In Excel, when TYPE is applied to an array, it returns 64. To test for whether a value is an array (and not just a single value) use:

Size(IndexesOf(x)) > 0

See Also

Comments


You are not allowed to post comments.