Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > Find the region containing the maxium values in What-If-Analysis matrix


Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2003, 09:33 PM
PhillipY PhillipY is offline
Newcomer
 
Join Date: Feb 2003
Location: Camas, Washington State
Posts: 12
Lightbulb Find the region containing the maxium values in What-If-Analysis matrix


Find the region containing the maxium values in What-If-Analysis matrix (C3:X24).

Note that the function are {Array Functions} enterd using "ctrl+shift+enter".

row of first max ={(MIN(IF((C3:X24)=MAX(C3:X24),ROW(C3:X24))))}

column of first max ={(MIN(IF((C3:X24)=MAX(C3:X24),COLUMN(C3:X24))))}

row of last max ={(MAX(IF((C3:X24)=MAX(C3:X24),ROW(C3:X24))))}

column of last max ={(MAX(IF((C3:X24)=MAX(C3:X24),COLUMN(C3:X24))))}

I need to transfer this from Excel to VBA, First how do you enter an Excell array function in VBA it must be more complicated than using "Applicaton.WorksheetFunction."

Second Make C3 and X24 in to variables.

I am building a solver for a system that use the "IF" function (a lot of them),
Excel Solvers wont allow the "IF" function, solvers work with normal math functions not logic functions, (the function has 2 variables to be optimised) the What-If-Analysis almost works.

My approach is since it will take to long to try every posable combination I use a Coarse What-If-Analysis matrix then the above functions to find the region containing the maxium values, then use a Fine What-If-Analysis matrix to zoom in on the region with more precision.

The reason for moving from excel to VBA is that Excel looses track of which came first the fine or the coarse What-If-Analysis matrix and produces results that are correct every other time that the test is done, it takes a long time to make a summary of the results indexed with a 3rd variable, hours for each sunmmary item and days for the hole thing.

Is ther a language better suited for array functions like this ?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Find array min/max values very quickly. Xombie General 30 03-16-2003 08:38 PM
Find & wrong values italkid Word, PowerPoint, Outlook, and Other Office Products 4 02-24-2003 12:39 PM
find only text values in Excel, not spaces TrentG Word, PowerPoint, Outlook, and Other Office Products 6 11-20-2002 06:13 AM
How can I check for duplicates before saving a new record GOTzMADsKILLz Database and Reporting 19 08-15-2002 11:56 AM
How to manage a matrix of values emanuele General 4 10-19-2000 01:33 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->