Code Notes 

The Excel formulas and the VBA code on this site were written for Excel97.  They may work in previous version of Excel, but they may not.  The formulas almost certainly will, but the VBA code is less certain.  In some cases, I note things that are exclusive to Excel97, but usually I don't.  Event Procedures, Conditional Formatting, and Data Validation were all added with Excel97, so none of these features will work in previous versions.

If you're copying formulas or code from this site into Excel, you might have problems with line breaks when Windows converts from HTML to text.  Some notes:

Formulas are always on a single line.  You may have to edit the formula in the formula bar to remove line break characters. Excel will have problems if there is a line break character (ASCII 10 or 13) in the formula.  Make sure you delete these.

VBA code is, of course, on multiple lines.  However, your browser may break lines where they shouldn't be.  When you paste the code into the VBA editor, the code will be in red if VBA detects a syntax error.  In this case, either go to the end of the line and press <delete> to move the line below onto the current line, or place a space and an underscore "_" at the end of the line.

Almost certainly, the indentation will be screwed up.  You'll have to fix this on you own.

The VBA code here assumes that arrays are zero-indexed, not one-indexed.  This means that the first element of the array is addressed with Array(0), not Array(1).  You should put  Option Base 0  as the first line in your code module.

I've tested the formulas and code on this site.  But much of it does not have any error checking at all.  And it doesn't have any On Error handling, unless that is critical to the logic. Test the code and formulas yourself!!!

You are free to use the formulas or code in any way you want.  If you use them in a commercial application, good for you. I hope you make big bucks doing so.  However, I make absolutely no warranty about the code.  If it doesn't work, I will refund exactly what you paid to get the code -- NOTHING!!   My Liability = Your Cost = Zero.