Custom Calculation to assume peak area of missing compounds as zero so that additional calculations return significant results


I am trying to use the custom calculation editor for additional calculations using peak area percentages. My formulas include all potential compounds that could appear on a given sample, although some of them might not be present sometimes. So, if in a given formula all included compounds are identified peaks, the result obtained is as expected. Nevertheless, if in a same formula I have identified & missing compounds, I get a blank cell as result (which is of course not what I want).

I would like to make the peak area percentages of the missing compounds equal to zero, so that the formulas where they are included give me back the results asked using the values of the identified peaks as such and zeros in case it is a missing compound.

Thanks in advance!

  • In your custom calculations, you may need to replace the Peak_AreaPercent fields with IIf(Peak_AreaPercent > 0, Peak_AreaPercent, 0) or something like that.  It might be easier to give a more definitive answer.


  • hello,I had the same problem as you to make the sum of impurities, I searched in the forum and I found the following formulas, to be verified because I am not an expert in formulas but it worked

    ListImpND (Type string, scope signal)  If (Count(CurrentSignal.AllMissingCompounds) = 0, "No Calibrated Peak(s) Missing ", "Fail " & string.join(" ", x.Compound_Name.tostring())))


    if(instr(ListImpND,"compound1")>0,0,(currentsignal.Allidentifiedpeaks.where(function(x)x.compound_name=("compound1")).select(function (x) x.GetDoubleCC("CC66")).first()))



Was this helpful?