Attached is an Excel spreadsheet with 28 columns of data. Each row represents a different day. I would like a VB or VBA subroutine/function that will find out how many of the columns cross on any particular day. For instance: 2/1/2007 124.47 106.16 122.68 2/2/2007 123.89 107.20 124.20 2/3/2007 123.31 108.23 125.71 on 2/2/07 column 1 and 3 crossed. I would like an efficient well though out function that will return another sheet showing the date and the total number of crosses each column has on a given row/date. I believe it should be something like the following but leave it up to the programmer for their professional judgement: Function cross(ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double, _ ByVal u1 As Double, ByVal v1 As Double, ByVal u2 As Double, ByVal v2 As Double) As Boolean Dim xi As Double, yi As Double Dim a1 As Double, a2 As Double Dim b1 As Double, b2 As Double b1 = (y2 - y1) / (x2 - x1) b2 = (v2 - v1) / (u2 - u1) a1 = y1 - b1 * x1 a2 = v1 - b2 * u1 xi = -(a1 - a2) / (b1 - b2) yi = a1 + b1 * xi cross = (xi <= x2) And (xi > x1) End Function
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Win XP/2k