Function GEOMEANyan(x As Range) As Variant ' author yuxing.yan at canisius dot edu ' date : 2/4/2013 Dim i, n, n2 As Integer, product As String product = x(1, 1) + 1 i = 2 n = x.Rows.Count n2 = x.Columns.Count If n > 1 Then Do While i <= n product = product * (x(i, 1) + 1) i = i + 1 Loop product = (product) ^ (1 / n) Else Do While i <= n2 product = product * (x(1, i) + 1) i = i + 1 Loop product = (product) ^ (1 / n2) End If GEOMEANyan = product - 1 'GEOMEANyan = n2 End Function