ࡱ>  |  S" !#$%&'()*+,-./0123456789;<=>?IABCDEFGH:JKLMNOPQRUVWXYZe\]^_`abcdTfghijklmnopqrstuvwyz{~Root Entry F>hWorkbook_VBA_PROJECT_CUR"%`h>hVBA%`hph ɀ\pSir Robin Goodfellow Ba= ThisWorkbook=x`; "8X@"1Arial1Arial1Arial1Arial1Arial1Arial1 Arial1$Arial1 Arial"$"#,##0_);\("$"#,##0\)!"$"#,##0_);[Red]\("$"#,##0\)""$"#,##0.00_);\("$"#,##0.00\)'""$"#,##0.00_);[Red]\("$"#,##0.00\)7*2_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_).))_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)?,:_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)6+1_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)                + ) , *       Q! !  ` Sheet183Source code distributed under the GPL. Read more at=You may use this code for any application, commercial or not.Aproduct as long as there is significant additional functionality.IIf you make an interesting modification to this code, please let me know!?You may use this code, without charge, for as long as you want.HYou may not charge for this code, although you may use it in a commercal!FFor a pretty spreadsheet which documents and provides examples, go see_You must also ensure that I (Philip Kromer) receive credit for this functionality, and that anyBperson who views the source code will also see these restrictions.Copyright Philip Kromer, 1999>http://mrflip.com/resources/ExcelFunctions/ExcelFunctions.html$http://www.gnu.org/licenses/gpl.html:source code to these modules remains visible and editable. 9CHowever, you must ensure that however the code is distributed, the >$Philip Flip Kromer  T ɀ   dMbP?_*+%M6HP DeskJet 820CseXC od,,LetterDINU"4$x$$$$"d,,??U} L} q                    $, >@74yK ?http://mrflip.com/resources/ExcelFunctions/ExcelFunctions.htmlyK ~http://mrflip.com/resources/ExcelFunctions/ExcelFunctions.htmlyK %http://www.gnu.org/licenses/gpl.htmlyK Jhttp://www.gnu.org/licenses/gpl.htmlyK  Philip Kromer <flip@mrflip.com>yK .mailto:flip@mrflip.com Sheet1 ThisWorkbookSheet1 LSFitCalculations$ MLSFitHelpers@1  !"#%&'()*+,-./012356789;<=>?@ABCDEFHIJKLMNOQRSTUVWXYZ[\^QQ#xME (SLSS<N0{00020819-0000-0000-C000-000000000046}8(%HxAttribute VB_Name = "ThisWorkbook" Bas0{00020P819-0C$0046} |GlobalSpacFalse dCreatablPredeclaIdTru BExposeTemplateDerivBustomizD2<DQQ#xME (SLSS<N0{00020820-0000-0000-C000-000000000046} @)` %h%Xhhn'w7 "  ophAttribute VB_Name = "She@et1" Bast0{00020820- C$0046} |Global!SpacFalse dCreatablPre declaIdTru BExposeTemplateDeriv$BustomlizD2P Sub Works_SelectionChange(ByVal Target As Excel.R ) End ߳0* pHd VBAProject4@j = r n'w7 J< rstdole>stdole f%\*\G{00020430-C 0046}#2.0#0#C:\WINNT\System32\StdOle2.tlb#OLE Autom`ation^MSFor ms>SFErms$3com= Released under the GPL, http://www.gnu.org/licenses/gpl.htmlis? If you use these routines you must ensure that the source code? may still be viewed in the VBA editor -- that is, you must not password protect these modules.2 If you improve these in an interesting way let me know: flip@mrflip.comD********************************************************************D********************************************************************D******************************************************************** This module computes the fit.D********************************************************************D********************************************************************D********************************************************************7 LSFitNoUncy(X, Y) returns the slope and intercept of aB least-squares fit to a line, in the case where neither variable has uncertainty.? First we compute the average X and average Y values, and theE sums of the X^2, Y^2, and X*Y vectors, called SumX2, SumY2, SumXY.6 We also compute the Sum Squared quantities, such as SSxx = Sum ((x - xavg)^2)0 This may be massaged into the more convenient" SSxx = SumX2 - N * AvgX ^ 2" SSyy = SumY2 - N * AvgY ^ 2% SSxy = SumXY - N * AvgX * AvgY Then we compute the slope as SSxy m = ---------- SSxx the y-intercept as b = AvgY - m * AvgX the slope error as! __________" / 1 ' dm = Sy * /\ / ------ \/ SSxx and the y-intercept error as5 ___________________________:QQxMEp+"`@ xxI$ `i& @( @* see`,as.e@. is@0 @2 f.or@4 u us`6 mus@8 urce@: till`< A ed@> mus@@ ord @B s.@D @F @H  k@J @L ****`N ****+^ RRI$ ****I& D**i` ****@( ****@* @, comp`b@d ****@. ****@0 ****@f ****@h ****`j ****@8 @: `< @l @n `p @> @@ @B @D @F @H @J @L `N ``Xn'w7 X0"  J 4` D$ D F F( &p  8   J JP J  &   J( Jx J > HX   F L ` <h & 6 ( (0 ,X  &       8 @ ` h ( ( $ $ ( &0 <X < : 4 P .X 8 : 8 *8 h p >x @ D @ HH * B @ BH J <  J( B x :   *  (H  `(L  2  Zh  (@  `  (  (02X  20  `px  :(V  H JP D H 0 P @X    H ( H <P , 6 , ,( 0X  &       8 @ ` h ( ( $ $ ( &0 <X < : 4 P .X 8 : 8 *8 h p >x @ D @ HH * B @ BH J <   J( B x :   *&0X  :p  (L  28  4p $  8 @ H P 0X         !  !0!H!h! !!!  !"("H"  (h"""  ("2"  2#P#0h#  `##$$($  :8$(Vx$  $ 0%xpD********************************************************************. Copyright 1999 Philip Kromer, flip@mrflip.__6 / 1 AvgX ^ 2 '3 db = Sy * /\ / ---- + ------------------- \/ N SSxx' where Sy is the standard error in y:2 ________________________________3 / SSyy - (SSxy ^ 2 / SSxx) '1 Sy = /\ / ------------------------------$ \/ N - 28 Several other coefficients are returned, specifically: the Pearson R^2 value; the Standard Error in Y, and the= Sum Squared of Residuals and the Sum Squared of RegressionB The values are returned in an array; this means that you should$ select two consecutive cells;< type in the formula as, for example, "=LSFit(A1:A10)": and then HIT CTRL-SHIFT-ENTER to fill the array in.< Alternatively, you may call LSFitSlope and LSFitInterceptD independently. Understand, however, that this will require twice6 as much work (the sums have to be redone for each).D********************************************************************3********************Declarations ****************** The size of the array]$ The Sums used to compute the LS fit](]@Xp The values to return.  ]0H,******************** Body ******************S Set N to be the length of the array; also check that the arrays are the same size. $ P!R%T'* & P!R%T', * ,'"zk *'( Compute the sums $ P!R%V'. & P!R%V'0 $ P!R%X'2 & P!R%X'4 $ & P!R%Z'6 Compute the sum squareds 2 . ( '8 4 0 ( ': 6 . 0 ( '<" Calculate the slope and intercept < 8'> 0 > . '@" Calculate the standard error in y : < 8  ( $\'H+ Find the Slope and Intercept uncertainties H 8$\'B H ( . 8 $\'DZ Find the Sum Squared of residuals, the Sum squared of regression, and the R^2 coefficient :'N > 8'L N L 'J L N'F4 Return an array containing the slope and intercept.  > @D B DD F HD L JDD'"ix D********************************************************************= LSFitYUncy(X, Y, YUncy) returns the slope and intercept of aB least-squares fit to a line, in the case where neither variable has uncertainty.: First we compute the weighted average X and Y values as AvgX = SumWX / SumW AvgY = SumWY / SumWA and the sums of the weighted X^2, Y^2, and X*Y vectors, called SumWX2, SumWY2, SumWXY.6 We also compute the Sum Squared quantities, such as% SSxx = Sum (wt * (x - xavg)^2)0 This may be massaged into the more convenient& SSxx = SumWX2 - SumW * AvgX ^ 2& SSyy = SumWY2 - SumW * AvgY ^ 2) SSxy = SumWXY - SumW * AvgX * AvgY Then we compute the slope as SSxy m = ---------- SSxx the y-intercept as b = AvgY - m * AvgX the slope error as! __________" / 1 ' dm = Sy * /\ / ------ \/ SSxx and the y-intercept error as5 _____________________________6 / 1 AvgX ^ 2 '3 db = Sy * /\ / ---- + ------------------- \/ N SSxx' where Sy is the standard error in y:2 ________________________________3 / SSyy - (SSxy ^ 2 / SSxx) '1 Sy = /\ / ------------------------------$ \/ N - 28 Several other coefficients are returned, specifically: the Pearson R^2 value; the Standard Error in Y, and the= Sum Squared of Residuals and the Sum Squared of RegressionB The values are returned in an array; this means that you should$ select two consecutive cells;< type in the formula as, for example, "=LSFit(A1:A10)": and then HIT CTRL-SHIFT-ENTER to fill the array in.< Alternatively, you may call LSFitSlope and LSFitInterceptD independently. Understand, however, that this will require twice6 as much work (the sums have to be redone for each).D********************************************************************`3********************Declarations ****************** The size of the array]0H$ The Sums used to compute the LS fit]`x] 3 An Array for the weights and the weighted x values]8Ph The values to return.  ](@,******************** Body ******************. Find the length of the array; also check that the arrays are the same size. $ P!R%T'* & P!R%T', ` P!R%T'b * , * b'^zkx *'() Compute the weights and the arrays, etc. `$r'l l$t l#DIV/O!#DIV/O!'^zkk $ l$v'n & l$v'p Compute the sums l P!R%x'd n P!R%x d'. p P!R%x d'0 n $ P!R%Z'f p & P!R%Z'h n & P!R%Z'j Compute the sum squareds f . d '8 h 0 d ': j . 0 d '<" Calculate the slope and intercept < 8'> 0 > . '@" Calculate the standard error in y : < 8  ( $\'H+ Find the Slope and Intercept uncertainties H 8$\'B H d . 8 $\'DZ Find the Sum Squared of residuals, the Sum squared of regression, and the R^2 coefficient :'N > 8'L N L 'J L N'F4 Return an array containing the slope and intercept.  > @D B DD F HD L JDD'^i> For more info see http://mrflip.com/resources/ExcelFunctions/%Attribute VB_Name = "LSFitCalculations"  Op$ Exp licit@Priva|Module '*@F Copyright 1999 Philip Kromer,D f @mr.com0For more info see ht tp://&/resources/ExcelFuncq/ Released under the GPL,#www.gnu.org"/ens#gp@l.htmlIf you useroutines must uPthatC/F cod' may still be vi$ewFinVB@A editr-F- is,,no' password proXtec2Dms.STim@ vE+anOte@I-g w#let m'know:^|**?D"$ ThiNsjmp@sBefitT?GRSa NoUncy(X, Y) return slope andGcept of a! jt-squa K `& to a Zl`c,")c o wh`O nei`or variab' hasscertaintyEY Fir kwe%3 average XY` luefA asums 8X^2AX*@hor`callrSumX`RYXYW lLsoj  Sd ntitiasuch asc  SSxx ((x - xavg)^2)CP`rm|-o"Bconveni,ena X2` N * Avg X ^ 2IyyUCYYxX6Y)  Y Then 1Dcyfm-Px`5y-`AeM")C b m$`!xerri0!i_c/a1 'd!Sy@ /\ `\b?C$T I 0# " t"h qn + V NUs@``WtaPmjy:?OLSS/- (`yA/dxx) H =_d: -8SeQAKl o rDeff CD,!w2D˃S'B vaaSr$, #, _%1HR2Val@*S= RegaTot'S Bodm<Oq! 1 SN$)a*length; F>heck/0CcO-tNaApa1#.Worksheet).Count(X(Г1 N??,4s p(@<> Ny)nsQR>0Nulq1Exit K #EUIfN') ( ' Y(X@@A*sU(Aa least-s fit to a line,AhDcase where nei r va@riablehas gay 4'First we:weighted a XRY lues a=@i'A8`umWXa# "YAFasaX^2@%X*@ector gcalledcY hWX YXYWlso`y @sntit`, such*aAc`x(wt@(xxavg) ^2! This$ mbbessKbo;mo2convenw&G   b)w({¡(2  eW) c`Then->sx:c`$m"-P$K9y-C+&b C- m$`! sb&w _/11A6 d `g* /\0 S _\2 +) : Q"| "h qn 0k  NUF`/}:?OR0/ `.mDR) H =/d - N2`#pSePl o r EVyQp>rrredDpeci{J3APea rson !}vaUpT;2BSE5YqKRE2Y>MP|t ?[{ ca}q}LeanQiat you shoulV! selpX tw1Unsecutivcells; aty`in0form?,  exampl k"=q(A1:`A10)"5n HIT CTRL-SHIFT- ENTERofill#in!_$AlPna1 ly, Y!cx7Vependly. Uq, howtq_wQrequi0twicvvmdw (=2nht boneach)kыڇ uS1 As Vqnt)#/Declara\s , &s8izeu}bDim N, Nx01 Nyegevr#S'R-sPco7LSǣ1W, qQR@4ρ~ay NyN% An p~,@- x7 W, Wxcy`o 32B8o0" z*".̲JVqga "C S"@! Body"*#q  @length#he array; also check that 'X se8same@ size.Nx = Application.Workshee tFunc"Count(XArr)fy$fY 3e%40Uncy8rIf ((<> N@y) Or  e)) Then|LSFitY#!9Null Exit l End( IfNx  ' Computweightts, etcWZ InvSq(AaNot Is ay(]!"#DIV/O!"lC+A>7: Wx",MulCy, B&bt C JsumsSumWA C 0AvgX /) / AYCX2Pro duct(P, Y#, ?!2h#n3 s@quarede4Sx2 - (0^ 2) *H+xSSy~`Y xXY 4* Y falculalslop`@linter(cepS= SS >`#IiA6vgA(Xo tandard error Pin ySbqr((AFw/`2)L Fi! !ertaie/A x_ g2a1W)< +6#' !um S@ of residu,;Cg2s, R^2 coefficien3STot@0%CSSRe~g!"7!' 's;-:CR2ValBa=@C' Retur.n na*ingBHDJð _ #6,6),t2q, Sy $s%I !Ё'!c*********************0 Files these commands under the right categoriesD******************************************************************** Help on Fit Functions  LSFit_HELPME;How to use the LSFit Function. The message box will pop upseveral times... Sorry.LSFit by flip@mrflip.com PB@~ Help on Fit Functions LSFitBoth_HELPME?How to use the LSFitBoth Function. The message box will pop upseveral times... Sorry.LSFitBoth by flip@mrflip.com PB@~ Main Fit Function LSFit@LSFit(X, Y, [Yuncy]): Array function. Performs a weighted least 7squares fit. Returns [Slope, Int; SlopeUncy, IntUncy; 4PearsonR2Value, StdErr in Y; Sum Sq Reg, Sum Sq Res]LSFit by flip@mrflip.com PB@~6 Iterative Fit Function for Errors in Both coordinates  LSFitBothGLSFitBoth(X, Y, Xuncy, Yuncy, slopeSeed): Array function. An iterative Aweighted least squares fit for data with errors in both X and Y. CReturns [Slope, Int; SlopeUncy, IntUncy; MinimizeThis, StdErr in Y]LSFitBoth by flip@mrflip.com PB@~) The function to be minimized for LSBoth.   LSFitBothMinimizeThisILSFitBothMinimizeThis(X, Y, Xuncy, Yuncy, slopeSeed): Use in conjunction Ewith Tools/GoalSeek and LSFitBoth to fit data with error in X and Y. =SlopeSeed is the correct slope if this function returns zero.LSFitBoth by flip@mrflip.com PB@~ Slope and Intercept  LSFitSlopeRLSFitSlope(X, Y, [Yuncy]): The slope of the weighted least squares fit to X and Y.LSFit by flip@mrflip.com PB@~ LSFitInterceptZLSFitIntercept(X, Y, [Yuncy]): The intercept of the weighted least squares fit to X and Y.LSFit by flip@mrflip.com PB@~# Uncertainty in Slope and Intercept LSFitSlopeUncyqLSFitSlopeUncy(X, Y, [Yuncy]): The uncertainty in fit for the slope of the weighted least squares fit to X and Y.LSFit by flip@mrflip.com PB@~ LSFitInterceptUncyyLSFitInterceptUncy(X, Y, [Yuncy]): The uncertainty in fit for the intercept of the weighted least squares fit to X and Y.LSFit by flip@mrflip.com PB@~& P R2 and Sy  LSFitR2ValLSFitR2Val(X, Y, [Yuncy]): The Pearson R2 value for the weighted least squares fit to X and Y. An indication of the goodness of fit; values near 1 are good.LSFit by flip@mrflip.com PB@~8 LSFitSy^LSFitSy(X, Y, [Yuncy]): The Standard error in y for the weighted least squares fit to X and Y. &QQxME |@00+ i @ F+v I i ? I@ ines@ t th@ ? m`(n th` is,@ p` e mo+r i flip`D**` ****` ****@D**hpn'w7 %0  J 4` D` D F F( &p  8   J JP J  F @ X ` :x H , L0 H  J J  Jp 6 J "H  P8p  88X  (@ @  <` @J  0 @V  x ( (P  *(@ (  ( (  ( (  J  J F0 2x   JB (  0@ P`hpx    J . JB X`   ( 0,P   J 4 J(B x     (0 8 HP xpD********************************************************************. Copyright 1999 Philip Kromer, flip@mrflip.com= Released under the GPL, http://www.gnu.org/licenses/gpl.htmlis? If you use these routines you must ensure that the source code? may still be viewed in the VBA editor -- that is, you must not password protect these modules.2 If you improve these in an interesting way let me know: flip@mrflip.comD********************************************************************D********************************************************************D********************************************************************? This module contains a couple of simple functions required by LeastSquares. Functions:4 ArrMult Multiplies two column vectorsB ArrInvSq Finds the inverse square of each element of& a column vectorF GetArr Extracts an array of values from an Excel RangeA Auto_Open Sets up the categories for these routines.D********************************************************************D********************************************************************D***********************************************LSFit by flip@mrflip.com PB@~ 8 Sum SquaresH  LSFitSSRegiLSFitSSReg(X, Y, [Yuncy]): The Model Squared Sum of Errors for the weighted least squares fit to X and Y.LSFit by flip@mrflip.com PB@~4 R  LSFitSSResfLSFitSSRes(X, Y, [Yuncy]): The Squared Sum of Residuals for the weighted least squares fit to X and Y.LSFit by flip@mrflip.com PB@~**o@ D********************************************************************nd intC Returns a 2-D array, indexed from 1, if the argument is an Object;riable@ !!! Warning !!! This assumes it is an Excel range object !!!!we+ Returns its argument if it is a 2-D array;= SumW Returns Null otherwisemWD********************************************************************alled@ $WY2, !!' $tealso 'dX 'kH i@ D********************************************************************be mas'Multiplies each element of two vectors.SxD******************************************************************** 2] 8Ph* AvgX]] $'te $'    'Sxy    '   'vzk '( '    b = $ $ +rror ! 'vi(D********************************************************************y * /-Inverts and squares each element of a vector.D******************************************************************** __](]@]X $' '   ^ 2 $ =#DIV/O!'rzd $ +k  S 'riph> For more info see http://mrflip.com/resources/ExcelFunctions/Attribute VB_Name = "LSFitHelpers" Option Explicit@PrivarModule '*@F Copyright 1999 Philip Kromer, f @mr.com0For more info see http://&/resources/ExcelFunc s/ Released under the GPL,#www.gnu.org/ens#gpl .htmlIf you useroutines must uPthat/!F cod' may still be viewFinVBA editr--# is,,no' password prot,ec2Dms.STimvVdanOte@I-g w#let m'know:^|**B"@ This@A@jntains auple of sR@fE requiro$byB LtSquaVa :C ArrMulti@@twolumn vvors InvSq Findsinve sB+each ment?a GetExtract"n arrCF"valuf v Kn RangIAuto_Opend Seupcgoria^qHj(4:??",8FilCma9ǒ$_ ASub RunM@eToFix!TWizard() 4' a @§XApa@.Macros _:=_HELPME",)Descri:= "How toe  .avessage box wpop up" & sedal times... Sorry.+BCRy:=4*StatusBar by`a? ?(;`?(!Both((۟ " <  MPY (c(%(O(O( D(X, Y, [Y_y]8): QP`. Perform!cwepat ( "cZs fitA`,Returf[Slope, Int; Uncy; "PearsonR2VX,dErr~ Y@um 1bRegs]/ X///x' I`A = l "co0in70n!:Ea0HA]XcsSeed A@ 9/ "\dataIt0yrrDb< X`sd Y>.!! "; MinimizeQ: e?9tANm?9e u0Z@mdLS|Q//. ߪo5iUЇ pconj0!m}"wi@Tools/Goal"k"ib k= ,a/1>' P rr if vr$Czerol/`oW'oW/HBIep`ȑ r/&:R'WTp1/7AUq(Oiq 0t///,'o`inHcepbnd Y.", _ Category:=4 StatusBar:="LSFit by fl ip@mr .com" ' Uncertainty in Sl ope aInterceptRApplication.MacroOp s z I]y Desc ri;)(X, Y, [Yuncy]): The Pfjfor t sVofweighted least squares to XiУȴJ mJws K!' R2cSyNR2ValB JPearson!value c An@dUgoodnes&s; s n@ 1 ?yPtsSyr(ndard errr`$s(aSum SL SReg?#Modeldd oE%@$??5""vs""sSFb2!Residual_"/_"_"["ESub !'*> '@ Returns a 2-Dray,exfrom 1argum ent in Object;Q !!! Wa rningThAsss #Exc'rangXe o!itf e @Null owrwisep c F}Q GetArr(A@ As Variant)+S`If Is")nq+ = .Cells. bu Else"ay0Q/ Af#$ UO`Multi each eleCb#}wo vP#ors.@b, B3Dim i, Na0b0gerTempAsab CB=5& )SNa`UBound(R) - L+ 1br/ &(<> Nb*A# Ex`<#$I`%Na5P.kCSFfiK To Za(p1)pR* r #NexIS  ;0UO'*,InvQdV-0a0/?/Sq"&)J/..xz,M,tI ls( 0p+ = 0UqR"#DIV/O!1,kT! %&=/ ^ 2 0(rrU T((7LSFitFunctions [GLSFitBothCalculations, }1LSFitBothFunctions&'_VBA_PROJECT  J @ ,X  ( JB & H  HP  J H  ,h  ( JB &0X  H`  J H0 8x JB &@  HH  J 4 ,P  ( JB &@  HH  J < ,X  ( JB & H  HP  J >  ,`  ( JB &(P  HX  xD**************************************************************************. Copyright 1999 Philip Kromer, flip@mrflip.com = Released under the GPL, http://www.gnu.org/licenses/gpl.htmlis? If you use these routines you must ensure that the source code? may still be viewed in the VBA editor -- that is, you must not password protect these modules.mo2 If you improve these in an interesting way let me know: flip@mrflip.comYuncD********************************************************************by fliD********************************************************************ZLSD********************************************************************it to 9 This module contains the interfaces to the functions inD LSFitCalculations. They simply digest their arguments, call LSFitUncy= (Which calls the appropriate function in LSFitCalculations)slop. and extract the appropriate field to return. Functions:.com LSFit& LSSlope LSIntercept* LSSlopeUncy LSInterceptUncy LSR2val LSSy" LSSSReg LSSSResD********************************************************************D********************************************************************]    'Help on LSFit routines'> For more info see http://mrflip.com/resources/ExcelFunctions/B   $' $ Slope Intercept 0 Slope Uncertainty Intercept Uncertainty . Pearson R^2 Value Standard Error in Y 3 Regression Sum of Sq. Residuals Sum of Squares'iD********************************************************************1 LSFit(X, Y) returns the slope and intercept of aB least-squares fit to a line, in the case where neither variable has uncertainty.8 LSFit(X, Y, YUncy) returns the slope and intercept of a< least-squares fit to a line, where the uncertainty in the Y-variable is known.For more information on what> least squn8QQxME(6 << < +`@l !!RHow to use the LSFit Function. The message box will pop upseveral times... Sorry. F 4@ .ph.@ taAn@ @ @ ? I+p`hX I$ xn thi&  musi` ect LSFit(X, Y, [Yuncy]): Array function. Performs a weighted least squares fit. Returns [Slope, Int; SlopeUncy, IntUncy; PearsonR2Value, StdErr in Y; Sum Sq Reg, Sum Sq Res]a 4+`h I$ Hi& rmuli` y FoRLSFitSlope(X, Y, [Yuncy]): The slope of the weighted least squares fit to X and Y.ti 4` the +`( I$ ERCEi& i` fielZLSFitIntercept(X, Y, [Yuncy]): The intercept of the weighted least squares fit to X and Y.  4` * +`H I$  LSSi& (D**i` ****qLSFitSlopeUncy(X, Y, [Yuncy]): The uncertainty in fit for the slope of the weighted least squares fit to X and Y. 4` + `  I$ @i& `:i` rns yLSFitInterceptUncy(X, Y, [Yuncy]): The uncertainty in fit for the intercept of the weighted least squares fit to X and Y.LS 4` slo+`h` I$ varii& Ci` retuLSFitR2Val(X, Y, [Yuncy]): The Pearson R2 value for the weighted least squares fit to X and Y. An indication of the goodness of fit; values near 1 are good. 4` Sta+ `(  I$  i&  arrai` on '^LSFitSy(X, Y, [Yuncy]): The Standard error in y for the weighted least squares fit to X and Y..  4` ment+ `P I$   i& 0 nfo i` /ModiLSFitSSReg(X, Y, [Yuncy]): The Model Squared Sum of Errors for the weighted least squares fit to X and Y. 4` + ` I$ @  Ri& ` ualsi` fLSFitSSRes(X, Y, [Yuncy]): The Squared Sum of Residuals for the weighted least squares fit to X and Y. the s 4` B p  % X  n'w7 $*\Rffff*0O409b99f2  J 4X D D F F  &h  8   J JH J  @ J0 D 4     ,8 0h & ( J J8 B    0 (H@ JH 8 H  8 >@ B   " D 4`  D < ( J0 B       J F@ 2 J B &( P  HX    J N( 2x J B &@  HHares is, and where these xany formulas come from,- see the book _D.C. Baird: Experimentation_> Notice that the arguments are (X, Y) -- the opposite of the6 order of the Excel commands "Slope" and "Intercept"D********************************************************************   `$ $ &$"'d $ & `$^'kiD********************************************************************? LSFitSlope(X, Y) returns the slope of the least-squares fit to+ X and Y. Se the preamble to LSFit, above.D********************************************************************  p Holds the return value of LSFit]pB LSFit returns the slope as the first element of a columen vector. $ & `$'$#'iD********************************************************************G LSFitIntercept(X, Y) returns the intercept of the least-squares fit to+ X and Y. Se the preamble to LSFit, above.D********************************************************************   Holds the return value of LSFit]B LSFit returns the slope as the first element of a columen vector. $ & `$'$#'i D********************************************************************: LSFitSlopeUncy(X, Y) returns the uncertainty in the slope% of the least-squares fit to X and Y." See the preamble to LSFit, above.D********************************************************************   Holds the return value of LSFit]B LSFit returns the slope as the first element of a columen vector. $ & `$'$#'i D********************************************************************B LSFitInterceptUncy(X, Y) returns the uncertainty in the intercept% of the least-squares fit to X and Y." See the preamble to LSFit, above.D********************************************************************   Holds the return value of LSFit]B LSFit returns the slope as the first element of a columen vector. $ & `$'$#'iD********************************************************************B LSFitR2val(X, Y) returns the R squared value of the least-squares2 fit to X and Y. Se the preamble to LSFit, above.D********************************************************************    Holds the return value of LSFit]pB LSFit returns the slope as the first element of a columen vector. $ & `$'$#'iD********************************************************************. LSFitSy(X, Y) returns the standard error in y% of the least-squares fit to X and Y." See the preamble to LSFit, above.D********************************************************************   Holds the return value of LSFit] B LSFit returns the slope as the first element of a columen vector. $ & `$'$#'iD********************************************************************6 LSFitSSRes(X, Y) returns the sum squared of residuals% of the least-squares fit to X and Y." See the preamble to LSFit, above.D********************************************************************    Holds the return value of LSFit] B LSFit returns the slope as the first element of a columen vector. $ & `$'$#'iD********************************************************************8 LSFitSSReg (X, Y) returns the sum squared of regression% of the least-squares fit to X and Y." See the preamble to LSFit, above.D********************************************************************    Holds the return value of LSFit] B LSFit returns the slope as the first element of a columen vector. $ & `$'$#'iL "&*.26:>BFJ<LSFit(X, Y) returns the slope and intercept of an unweighted @ least-squares linear fit. X and Y should be columns of data. @LSFit(X, Y, YUncy) returns the slope and intercept of a weighted ; fit. YUncy should be the Uncertainty in the Y-variable.   CIn both cases, the function returns an array of values, of the form . Slope Intercept 3 Slope Uncertainty Intercept Uncertainty . Pearson R^2 Value Standard Error in Y 2 Regression Sum of Sq. Residuals Sum of Squares   HFor how to enter an array formula search Excel Help on 'Array Formulas'. GFor more info on least squares fitting see D.C. Baird: Experimentation. ?Notice that the arguments are (X, Y) -- the opposite order from 'the Excel commands SLOPE and INTERCEPT.   HThis box will appear several times, I'm not sure why. Sorry about that.   8More info at http://mrflip.com/resources/ExcelFunctions/' "CAttribute VB_Name = "LSFitFunctions" Op$ Explicit '*@ Copyright 1999 Philip Kromer, f @mr.com0For more info see http://&/resources/EPxcel/@Released under th@e GPL,#www.gnu.org/vens#gpl.htmlIf you userou tines mu(st uPth at/F code may still be vHiewFinVBA editr-- is,,no password protec2Dmodules.23T4imvV4ante[g wA#let m'kpnow:^|** A"$4 This@AP@jntainsdinJfa toBfQCalcula5.ey_ly` digeir argumentuca(Which A apnpriaW )and extraC ield0@returnň c:b G`SlopebLSI"cep"RLSUncy` R2va.ly)SSReg-`s7: aZ(3_HELPME() As Va@8^n$",.@D`escriì Howa5C &5Kussage box wpop upsever*tim@.. S`orry.ProcData!Invoke_aa \n4`a0Dim#Help, Style, TitResp#MyS`ng< b vbOKOn b+ vbI rmaBDefaultButton2 a onD!e$cb*= _C!(X, Y) {_ksZfB|AY of unweAed" & CrI t-sHqua l ar fit3X`d Y shouncolum d, ""e Ya  erNtyE!Y-v+ble6. " rIn(t!L`s,R8arr@g ?uePform OH9FOa"@CI2 PeaDrs)R^2>lRuQSt %ayErrp|wYOEM#sp Sum' Sq$4idualsWr&rhDgЎjYar gr 56'Am0s'_ y "21 510'AD.C. Baird: `erI0v?NoticaTvsIte R2) Re opposiPr@`f/a"a&m LOPE";INTERCEPT? 3 /sƒXpw!X, I'm suwhy`Y abs2atooiHM0%@Z/jS[PVMsgBox(TK^@VlQS6 J:&Zǣ:9ntyO{99 9?^99 9c`pE0s-a10/o/l,\l1 jP9a"k,%_"c wh@ ndei@2r 5`Chascbkv^ۑ6/vt"v ss Aжjgj ߁eI%Iw٨J1@Fxanty tRs qE,AM book _MaA 1'#MMMfQtMrLL"r3"R "g6 y$c*& Function LSFit(XArr, Y As Variant@, _ Oplal YUn,cy ` /)H Attributeo.VB_DescriM = ", [Y y]): _ay f. Performs a weighted least squares fit. Returns [Slope, Int; Z;(arsonR2ValuStdErr in Y um Sq&g,D Ss]"gProcDatamInvoke_am \n4If IsMissing() TxhenNoU)ElseH US nd IfC E@EA''W 'C|^(X!) rgthe sg of Br"-Hr toAX Ja(YuSe p@reamblo, above.@ -**D/O0@?CUD$#ˀH+*d@+ *ZfZ!' Holdsb3; vi;BXMDim5K(/P# pDa fir}element a colu vector`@  =CabBEn(0)@!a?c?cP@L$c@er8cep9cintc?d?d?d_"-d`'d_A9d5e(e.,?fd Y./ffff DI_3 _3_3_3ru0_3p$dR3f31@e3&a;q3ertay|3f?fs)QpSegg g`  P4A$7#RP4#|4l ra~_6śi _6_6ip_62it_6_6ii`i_Y6fY61io `+o&/.>q  67dkA66p6 k #74a%177ql_7S7O7c O7?nӤ77 88 iߡaA"&C68888888a 8\8nQ-?(q1BR2 7 R麟d value of the least-squares ' fit to X and Y.  Sepreambl0o LSFit, abo(ve.h*@ Function ^R2(XArr, Y As Variany_ Op;al YUncy 0 /)$ Attribute:.VB_Descri) = "xR2Val(X!G, [YVy]): TPea$rs\R2forweight4ed An indicagoodnessՀ;-s nQ6 1 ."cProcDataiInvok e_4 \n4@AQ' HoldsB,return1"B>C[DimCI WC' CCslope afirst el ement6a colu@ vector$=C_Dx) 5(2)(01 E Oº&SyB) @@ @B @D @ `J +h In ip i> `****` ****@ ` ****+ I (i rray`` ` hhums h0n'w7 0  J 4` D D` F F &( P 8X   J J JX  H $   J( Jx B  :  0P  $X  *   ( 6H  2  4 $0H` ,x 0 ".@p  "  0  LP B L &8 ` h  $      B 4@ x @ B  B X ` h p x     b P @h L 8 R0 : \  ( 8Xp  8 6*"H 0p(Z  0h   J L 0 &P $x  JB   0 @ HJh   J @( JhB   " 8 H P xpD******************************************************************** . Copyright 1999 Philip Kromer, flip@mrflip.comy. F? If you use these routines you must ensure that the source code? may still be viewed in the VBA editor -- that is, you must not password prote LSFitBothMinimizeThis function. '> 0 > . '@ Find the X, Y, U and V arrays $$' &$' $ .$' & 0$';-----------------------------------------------------------. Loop to accumulate alpha, beta, gamma, delta.: We accumulate each of the required sums... note that for; alpha and beta we need to divide off (3 delta) at the end.<------------------------------------------------------------''''''B'D'J  (  $ $ $ $n '  $ $ $n '  $ $ $ '  $ $ $n '  $ $ ' B $  $ $  'B D $ $ 'D J $ $ @ > $  'J  Fix alpha, beta, gamma  '    '  '2 Fix the Uncertainties (note: these are estimates;0 see Am. J. Phys 58 #2 (1990) p 189 for info). (  B $\'B D  B$\'D* We Must Goal Seek to return this function        ' Return our values!   > @D B DD  JD  D  DD'iD********************************************************************E Given weights in Wx and Wy, and a slope m, computes the total weight 1 Wt = ----------------------- (m^2 / x) + (1 / y)D********************************************************************h]] ]8P n$' p$' '    > $ $  +  'i D********************************************************************: Subtracts a constant value from eache element of an arrayD********************************************************************h]]] $' '    $  +  'i( = Released under the GPL, http://www.gnu.org/licenses/gpl.html> For more info see http://mrflip.com/resources/ExcelFunctions/]Attribute VB_Name = "LSFitBothCalculations" Op$ Explicit@PrivaModule 0 '*@F Copyright 1999 Philip Kro@mer, f @mr.com0For more info see http://&/resources/Exc@elFuncq/ Released under the GPL,#www.gnu .org/ens#gpl.htmlIf yo`u useroutines must uP0that/F cod' may still b@e viewFinVBA edditr-- i$s,,no' password protec2eDms.STim@ vE+anOte@I-g w# let m'kn8ow:^|**?B"@ 0This@A performs ,Wegl@xar t squa!@O fitCPitherrors9@W b@|hindB<@#1%cB *(XAroYXUncy&slopeSeed) As VarianR RDeclar:ap $`0e size ofa arrayDim N, Nx`*yeeIntegeri'b s to@4mp9gWtWxA  aXVal tYUViSuKd LSK'alpha,`tgammdelta@AvgX, Yd, @ Wt!U2Nvalu`$returneeS?, .pt, _#AEMinim=nSR Ja G** Bo dyVJ Fin`-lengthjL; 8Aheck®$Ps @~NsT$"Nx`A paa\.Wor@ksheetk.Countj) Nybpex -`P   NY o((@<> Ny) Or xeye)z)5nszE Nul@t1Exi,t ECE0IfNxc'=:wY@4=, xetcd;pI`nvSq(LTWy"== `ot Isay(bpby) e"#DIV/O!"#gHp ! Els`|1"#ERR! cbQ4Tota&lrc, b , b7Average X and Y CFJ44P(BdNo17@PrcC8p ]) /#R1S<q'G'2Q"6S (e: we don't actually_hR!K pteУw ' Given weightsT Wr Wy, aac7 m, compu_b@FtG1hWt @0-K(m^2@ax) Db:y'`? CE(`ndToW(, WyB As Variant@8()hCMDim ipgerTemp gWx! ('Ge""!Wy= e%=PS SFAILBou nd ) To U$f= RKt_`= 6c D`ai* //'Subtracp/a-nst0D from eac0aelemen0t of1``ra>y))DeHviaqW(Ap#, AvgA!''Q%A?S%q= 2S$$ !-RO"F@"V)"a" Pthat/F code may still be viewFinVBA editr-- His,,no password protec2DmodulesN.23TimvV4ante-g w#let m'know:^|** A?"$4 pThis@AP@jn tainsdinJfa toBfQCalPcula.ez`ly digeir arguments,ca and extraCv ap@ppriaAfield"r eturnz uF:  Minimize@b!: cD_HELPME() As Va!na .Descri×Howa'wG '6`assage box w!upop upseveral timl.. So0rry. Pr@ocData!Invoke_0 \n43Dim#Help1,g2h3, Style, TitaRespMySng b vbOKOnP+ vbI@rmabDefaultButtxon2  on Dc/;_cA(X, Y, XUncy ) #Xl`slope_mcept of" &Cr ` `we`t-sHqua@ l`ar fit, whBvd/ has errors; b@in@ns`BXBY shouocolDum of a .7 ha@errti@ȠX- Y-va\b! TׂTw" by 1/^2Larr0a valuegàa form@S"?ITO"@C` Dy3 ?%N]#U03iduals Sumyp& S#T-a-2g-bdoy W[``6_p_ a -@$I0v;@Hdc "conj$fGth Tools/Go@alSeekLfvi0b1bAeNig!+:eef'p0d d,)ty8'atial  P"4Drantop7 ^lYg0'spG.n h  ~"({ypzpero; 3`n? cp\qD 6 givy A0S.%/ !eupR ra¨sW; if so it@?2obvio us`jZgraphing. Ipc@`art)KaffRnrt#. 0a!^3Ì0archf c'ADmѰs' Э'"0k'I "0 trechniqDueRee+AmJPhys 57 #7 p. 645OB r~M&Šp!Pw/Bx MsgBxox(r$q|i{) 2{~s,< RBs [rX,#[; YY;zU?,gs W.]`E1AQS /̈V0 11{apality0b! a6M4C<&^Fa٤` a#;7~g]PRNdo%1HĢ1!FPpap0K"LsȒes fits with errors ' @ in bocoordinates," Am. J. Phys 57 #7 p. 642 (1989) By B.C. Ree,d.*@ Function LSFitB(XArr, Y As Variant, _ XUncy- 1slopeSc,) AttributeN.VB_Descrip[= "\[, Xiy8): aUay f . An iterative weighted least squar for 0dataX and Ytu@rns [Sr, Int; G; MinimizeThis, StdErrY]" =3lmd' HoldsSW va8lue!VDim#C+@'_Eca fir e@lement aI\lu v]orY =# ̺?!# (20)(0)a JB$  lueKBArri`Na\^Nb]^TempArrMAValsNBValsLSFitFunctions/ LSFit_HELPMEp LSFitHelpQStylepTitle~ResponseMyStringvbOKOnly vbInformationnvbDefaultButton2vbCr$MsgBoxRLSFit1] IsMissing LSFitSlope1LSFitArr*LSFitIntercept[LSFitSlopeUncynLSFitInterceptUncy LSFitR2valLSFitSy@ LSFitSSReg LSFitSSResLSFitBothCalculations LSFitBothCalc=XUncyArr' slopeSeedӛ QhxME+P@ ""VHow to use the LSFitBoth Function. The message box will pop upseveral times... Sorry. more  4@ as.e@ is@ @ @ u us@ mus@ urce+0 I$ ord i& I i` i LSFitBoth(X, Y, Xuncy, Yuncy, slopeSeed): Array function. An iterative weighted least squares fit for data with errors in both X and Y. Returns [Slope, Int; SlopeUncy, IntUncy; MinimizeThis, StdErr in Y] 4+H I$ hi& I i` i LSFitBothMinimizeThis(X, Y, Xuncy, Yuncy, slopeSeed): Use in conjunction with Tools/GoalSeek and LSFitBoth to fit data with error in X and Y. SlopeSeed is the correct slope if this function returns zero. 4` Pn'w7 X J 4X D D F F &  H 8P   J J JP  @ D D0 x  2  J J( Bx,  P Hx (` @ X p   J Fp F J P X Bx L  J B$h   J B H@  JB$  &(  H0x  hxD********************************************************************. Copyright 1999 Philip Kromer, flip@mrflip.com ? If you use these routines you must ensure that the source codece? may still be viewed in the VBA editor -- that is, you must notus password protect these modules.2 If you improve these in an interesting way let me know: flip@mrflip.comflipD**************************************************************************D**************************************************************************D**************************************************************************9 This module contains the interfaces to the functions in= LSFitBothCalculations. They simply digest their arguments,D**= call LSFitBoth and extract the appropriate field to return. Functions:****, LSFitBoth LSFitBothMinimizeThisD******************************************************************** the aD********************************************************************te the] 8    'ums Help on LSFit routines'$ "@LSFitBoth(X, Y, XUncy, YUncy) returns the slope and intercept of B an weighted least-squares linear fit, where the data has errors ; in both coordinates. X and Y should be columns of data. G XUncy and YUncy should be the uncertainties in the X- & Y-variables. ( The data will be wighted by 1/Uncy^2. 4The function returns an array of values, of the form . Slope Intercept 3 Slope Uncertainty Intercept Uncertainty 7 Minimize This Residuals Sum of Squares'#DIV  FThis function does not actually _compute_ a slope. It must be used in Econjunction with Tools/GoalSeek to find the best slope. Designate one Acell as a slopeSeed, and type in an initial value for the slope.  JDesignate antoher cell for the LSFitBothMinimizeThis result. Goal seek the Fvalue of LSFitBothMinimizeThis to be zero; the slope cell then has the Icorrect result. LSFitBoth gives all the other information. This function  Mmay end up with the worst slope rather then the best slope; if so it will be  Lobvious upon graphing. In that case start slopeSeed with a different value. '   $'   $'   $'BNLSFitBoth Returns [Slope, Intercept; Slope Uncertainty, Intercept Uncertainty;$MinimizeThis, Regression Sum of Sq.]'i`D******************************************************************** @ LSFitBoth(X, Y, XUncy, Yuncy, SlopeSeed) returns the quality of@ fit for the line with slope SlopeSeed. It does not compute a D slope; you must use goal seek and LSFitBothMinimizeThis to do so.   For more information,< see the the paper "Linear least-squares fits with errors 'F in both coordinates," Am. J. Phys 57 #7 p. 642 (1989) By B.C. Reed.D******************************************************************** P $ &  ` $''iD********************************************************************. Phys< LSFitBothMinimizeThis(X, Y) returns the quality of the line\'A with given slope. The slope is correct if this function returns zero.D********************************************************************  Holds the return value of LSFit]B LSFit returns the slope as the first element of a columen vector. $ &  ` $'$#'i= Released under the GPL, http://www.gnu.org/licenses/gpl.htmld er(> For more info see http://mrflip.com/resources/ExcelFunctions/P CFor more info search Excel Help on 'Array Formulas' or 'Goal Seek'. >For more info on this technique see Reed, AmJPhys 57 #7 p. 645   8More info at http://mrflip.com/resources/ExcelFunctions/'h@#X׷Attribute VB_Name = "LSFitBothFunctions" Op$ Explicit '*@ Copyright 1999 Philip Kromer, f @mr!.com0For more info see http://&/resources/Excel/@Released under the GPL,#www.gnu.org/vens#gpl.htmlIf you useroutines must uNxeaWtArrXValsjYVals5UArrG[VArr alphabeta.gammadeltaSumWt SumWU2  MinimizeThisCFindTotalWeight FindDeviation:WxValsWyVals AvgAYXLSFitBothFunctions&LSFitBoth_HELPME LSFitHelp1t LSFitHelp2t LSFitHelp3t LSFitBothgLSFitBothMinimizeThisY WorksheetWorkbookk {! ~.DLL#Microsoft Office 8.0 Object Library  n'w7 QThisWorkbook0>409b97aaThisWorkbookQ% dir$PROJECTwm4CPROJECT :SummaryInformation(G DD452EE1-E08F-101A-8-02608C4D0BB4 DDOWSEFM20.DLL#Microsoft E: ] Ob Library/;D1t00}#0#k0jABEA24BCF-7F5D-4543-B6F7-8F43698AF74@Xc:\Vp\VBE\M.exd`5.E .`M ÃOffi căOfijcƒ *2DF8D04C-5BFAaB-BHDE5@CAA4 2a@gram Files\Applics@/C\MSO97Lh 8.0h@#EQThisWorkbookGD Th3sDW•kboPk 2 QHB1%B,!Q"B+BۀSheet1GS@#eVt1 [Aq2  LSFit@Calcul-G*Lki}Ca}cuaJi@"nn2M/:/$Q!b#($AHelpersc7EGH`&lprc7/&/2"Func` g F)nejtLo"!2N+Lt8%'(" BotZh>*A>B409b97aaThisWorkbookQ% Sheet10?409b97aa Sheet1Q"LSFitCalculations0@409b97aa "LSFitCalculationsQ0:LSFitHelpers0A409b97aazLSFitHelpersQH&LSFitFunctions0O409b99f2LSFitFunctionsQ`t8*LSFitBothCalculations0C409b97aa*LSFitBothCalculationsjx%$LSFitBothFunctions0D409b97aa$LSFitBothFunctionsh0Hx`vXLbڠ?U@Gt=8MFYoǓGMR 3VmlIh<3A2ƐkʭYI K;[ 9P7Excel+VBAWin16~Win32MacVBA6# VBAProjectstdole`MSFormsCOfficeu ThisWorkbook| _EvaluateSheet1Worksheet_SelectionChange4TargetFRange LSFitCalculations LSFitNoUncyXArr`YArrG[NeNxs^Nyp^AvgXpXAvgYmXSumX2D SumY2 SumXYg SSxx0SSyy0SSxy0Slope# Intercept6D SlopeUncyV InterceptUncy8R2Val̡Sy)_SSRes'SSRegSSTotL Application*WorksheetFunction&Count0vAverageSSumSq  SumProductSqr( LSFitYUncybAYUncyArr NyeSumW :SumWX2 SumWY2 SumWXY WArr WxArr[WyArrBArrInvSq6IsArrayArrMultfSum LSFitHelpersRunMeToFixFuncWizard MacroOptions^Macroc Description Category\ StatusBarʜGetArrAArrIsObjectCellsVaonsLSFitBothFunctionsLSFitBothFunctionsID="{77100ED0-2C62-11D3-B97B-00C04F771FD9}" Document=ThisWorkbook/&H00000000 Document=Sheet1/&H00000000 Module=LSFitCalculations Module=LSFitHelpers Module=LSFitFunctions Module=LSFitBothCalculations Module=LSFitBothFunctions HelpFile="" Name="VBAProject" HelpContextID="0" VersionCompatible32="393222000" CMG="87853A423A423E463E463E463E46" DPB="87853A423A423B433B433B" GC="87853A423A423B433B43C4" [Host Extender Info] &H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000 [Workspace] ThisWorkbook=0, 0, 0, 0, C Sheet1=162, 162, 684, 594, I LSFitCalculations=180, 180, 702, 612, LSFitHelpers=163, 594, 685, 1026, LSFitFunctions=39, 429, 1129, 842, LSFitBothCalculations=18, 18, 1046, 910, I LSFitBothFunctions=36, 36, 643, 325, Oh+'0 `h  Weighted Least Squares FitsWeighted Least Squares FitsFlip Kromer of5Weighted Least Squares Squared Fit Uncertainty ErrorwcA linear fit that takes uncertainty in the data into account. Gives advanced fit statistics, too.Sir Robin Goodfellowes Microsoft Excel@7jo@ihDocumentSummaryInformation8P,CompObj]f՜.+,D՜.+,H X`|  Least Squares FitsModphy: UT Modern Physics Labe{ Sheet1  Worksheets 8@ _PID_HLINKSAuMmailto:flip@mrflip.comO\%http://www.gnu.org/licenses/gpl.html!%?http://mrflip.com/resources/ExcelFunctions/ExcelFunctions.html FMicrosoft Excel WorksheetBiff8Excel.Sheet.89q