'Log10 'Auther : Kouichi Abe 'Aoki Applied Acoustics '2001/7/11 Created 'copyright 2001- 2008 Aoki Applied Acoustics co., ltd ' Private Function Log10(x) Log10 = Log(x) / Log(10) End Function 'PowerAve 'パワー平均する関数 '与えられたセルの値をパワー平均する 'セルの値が文字列、または空の場合は無視する ' '戻り値は、計算したパワー平均値。計算対象となるセルの個数が '0の場合、空の文字列を返す。 ' 'Auther : Kouichi Abe 'Aoki Applied Acoustics '2001/7/11 Created 'copyright 2001- 2009 Aoki Applied Acoustics co., ltd ' Public Function PowerAve(ParamArray data()) Dim num As Integer Dim psum As Double num = 0 psum = 0# For Each cRange In data For Each cCell In cRange If Not IsEmpty(cCell) And IsNumeric(cCell) Then psum = psum + 10 ^ (cCell / 10#) num = num + 1 End If Next Next If num <> 0 Then PowerAve = 10# * Log10(psum / num) Else PowerAve = "" End If End Function 'PowerSum 'パワー合成する関数 '与えられたセルの値をパワー合成する。 'セルの値が文字列、または空の場合無視する。 ' '戻り値は、計算したパワー合成値。計算対象となるセルの個数が '0の場合、空の文字列を返す。 ' 'Auther : Kouichi Abe 'Aoki Applied Acoustics '2001/7/11 Created 'copyright 2001- 2009 Aoki Applied Acoustics co., ltd ' Public Function PowerSum(ParamArray data()) Dim psum As Double psum = 0# For Each cRange In data For Each cCell In cRange If Not IsEmpty(cCell) And IsNumeric(cCell) Then psum = psum + 10# ^ (cCell / 10#) End If Next Next If psum <> 0# Then PowerSum = 10# * Log10(psum) Else PowerSum = "" End If End Function