Example custom functions

Below are some common functions that may be helpful. See also “Custom functions list”.

if(CobsPop==0.01, 1, 0) or; 

If any cell in the mapped column “CobsPop” is equal to 0.1, then enter a 1 in the new column; otherwise enter a 0.

Note the 2 equal signs.

if(CobsPop = 0.01, 1, 0) 

If any cell in the mapped column “CobsPop” is equal to 0.1, then enter a 1 in the new column; otherwise enter a 0. (Same as previous function.)

Note the space before and after the single equal sign.

if(CobsPop = 0.1, 1, if(CobsPop < 1, 2, 0)) 

If any cell in the mapped column “CobsPop” is equal to 0.1, then enter a 1 in the new column; if it is less than 1, enter a 2; otherwise enter a 0. (This is an example of an embedded “if”.)

Note the space before and after the < sign. Alternatively, use two < signs (“<<”) without spaces.

if(CobsPop = 0.1, 1, if(id==1, 2, 0)) 

If any cell in the mapped column “CobsPop” is equal to 0.1, then enter a 1 in the new column; if the mapped column “id” is equal to 1, enter a 2; if none of these conditions are met, enter a 0. (This is an example of an embedded “if” with different variables.

Ln(conc) 

Write the natural log of the value in the mapped column “conc” in the new column.

replace(conc,2,2,"LQ") 

Starting at number 2 position in the mapped column “conc”, replace the string with 2 letters “LQ”.

This is useful for converting BQL to BLQ but notice that it does not discriminate, so a number 1.537753 ends up being 1LQ37753 (position 2 and 3 replaced). Use with caution.

substitute(conc,”BQL”,0.1,0) 

In the mapped column “conc”, replace each cell value found to be equal to BQL with 0.1 in the new column.

substitute(CobsPop, 0.1,"BQL",0) 

In the mapped column “CobsPop”, replace each cell value found to be 0.1 with “BQL” in the new column.


Legal Notice | Contact Certara
© Certara USA, Inc. All rights reserved.