View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default LINEST multiple known_x's separated arrays

Sorry for the previous posting. Fat-finger missend.

"Rickemil" wrote:
joeu2004 escribió:
v1 = r1
v2 = r2
n = UBound(v1, 2)
If UBound(v1, 1) < 1 Or UBound(v1, 1) < 1 Or n < UBound(v2, 2) Then

[....]
But, I dont understand why this part of the function repeat twice:
UBound(v1, 1) < 1 Or UBound(v1, 1) < 1


Typo. The line should be:

If UBound(v1, 1) < 1 Or UBound(v2, 1) < 1 Or n < UBound(v2, 2) Then


"Rickemil" wrote:
v1 = r1
v2 = r2
v3 = r3
n = UBound(v1, 2)
If UBound(v1, 1) < 1 Or UBound(v1, 1) < 1 Or n < UBound(v2, 2) Then


For completeness, the test should be:

If UBound(v1, 1) < 1 Or UBound(v2, 1) < 1 Or UBound(v3, 1) < 1 _
Or n < UBound(v2, 2) Or n < UBound(v3, 2) Then

That determines if r1, r2 and r3 are 1-row horizontal ranges, and all ranges
are the same number of columns (n).