gsheetsCode.js
/**
* Returns a 2 line header for the specie decomposition.
*
* @customfunction
*/
Returns a 2 line header for the specie decomposition.
Returns a 2 line header for the specie decomposition .
function createDecompHeader(){
  try{
    var numOfPredictiveGroups = 31
    var columnHeaders = []
    var pDataArray = SpreadsheetApp.getActiveSpreadsheet().getRangeByName("PData_Properties").getValues();
    var group1Index = pDataArray[0].indexOf("(GROUP 1)");
    var columnHeaderIndexes = ["Indexes"]
    for(var j = group1Index; j < numOfPredictiveGroups + group1Index; j++){
      columnHeaderIndexes.push(j)
    }
    columnHeaders.push(columnHeaderIndexes)
    columnHeaders.push(["Groups","CH3","CH2","CH","C","CH4","C2H6","CHaro","Caro","C, aro-fused rings","CH2, cyclic","CH/C, cyclic","CO2","N2","H2S","SH","H2O","C2H4","CH2/CH, alkenic","C, alkenic","CH/C, cycloalkenic","H2","CO","He","Ar","SO2","O2","NO","COS","NH3","NO2/N2O4","N2O"],
                       ["Groups Names","(GROUP 1)","(GROUP 2)","(GROUP 3)","(GROUP 4)","(GROUP 5)","(GROUP 6)","(GROUP 7)","(GROUP 8)","(GROUP 9)","(GROUP 10)","(GROUP 11)","(GROUP 12)","(GROUP 13)","(GROUP 14)","(GROUP 15)","(GROUP 16)","(GROUP 17)","(GROUP 18)","(GROUP 19)","(GROUP 20)","(GROUP 21)","(GROUP 22)","(GROUP 23)","(GROUP 24)","(GROUP 25)","(GROUP 26)","(GROUP 27)","(GROUP 28)","(GROUP 29)","(GROUP 30)","(GROUP 31)"])
    return columnHeaders
  }catch(myErrorMessage){
  return myErrorMessage.message
  }
}
function createDecompHeader ( ) { try { var numOfPredictiveGroups = 31 var columnHeaders = [ ] var pDataArray = SpreadsheetApp . getActiveSpreadsheet ( ) . getRangeByName ( "PData_Properties" ) . getValues ( ) ; var group1Index = pDataArray [ 0 ] . indexOf ( "(GROUP 1)" ) ; var columnHeaderIndexes = [ "Indexes" ] for ( var j = group1Index ; j < numOfPredictiveGroups + group1Index ; j ++ ) { columnHeaderIndexes . push ( j ) } columnHeaders . push ( columnHeaderIndexes ) columnHeaders . push ( [ "Groups" , "CH3" , "CH2" , "CH" , "C" , "CH4" , "C2H6" , "CHaro" , "Caro" , "C, aro-fused rings" , "CH2, cyclic" , "CH/C, cyclic" , "CO2" , "N2" , "H2S" , "SH" , "H2O" , "C2H4" , "CH2/CH, alkenic" , "C, alkenic" , "CH/C, cycloalkenic" , "H2" , "CO" , "He" , "Ar" , "SO2" , "O2" , "NO" , "COS" , "NH3" , "NO2/N2O4" , "N2O" ] , [ "Groups Names" , "(GROUP 1)" , "(GROUP 2)" , "(GROUP 3)" , "(GROUP 4)" , "(GROUP 5)" , "(GROUP 6)" , "(GROUP 7)" , "(GROUP 8)" , "(GROUP 9)" , "(GROUP 10)" , "(GROUP 11)" , "(GROUP 12)" , "(GROUP 13)" , "(GROUP 14)" , "(GROUP 15)" , "(GROUP 16)" , "(GROUP 17)" , "(GROUP 18)" , "(GROUP 19)" , "(GROUP 20)" , "(GROUP 21)" , "(GROUP 22)" , "(GROUP 23)" , "(GROUP 24)" , "(GROUP 25)" , "(GROUP 26)" , "(GROUP 27)" , "(GROUP 28)" , "(GROUP 29)" , "(GROUP 30)" , "(GROUP 31)" ] ) return columnHeaders } catch ( myErrorMessage ) { return myErrorMessage . message } }
Returns a 2 line header for the specie decomposition.
Returns a 2 line header for the specie decomposition .