Sign in to follow this  
Followers 0
icu

Anything like Goal Seek in AutoIt?

4 posts in this topic

Dear AutoIt Community,

I was wondering if AutoIt has a Goal Seek function like what you get in Excel?

Good old F1 doesn't shed any light on the matter.

Many thanks,

-icu

Share this post


Link to post
Share on other sites



I don't think so. AutoIt has the math functions you can find in the help file. Some UDFs might extend the functionality.

But it depends on what you want to do.

You could either write the function you need with AutoIt or let Excel do the calculations.

Can you describe in more detail what you want to do?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

@water: Thanks for your quick reply. Yeah if you have the underlying formula you can always use algebra to solve for the goal seek.

I was just being lazy because I know the formula to solve for the goal seek. In this particular case I wanted to write a GUI for math noobs at work to work out the card charges embedded in the price we charge customers.

For example,

Let

Amount without card charge = a

Total amount = T

Card Charge = c

If

T = 100

c = 0.025

And

T = a x (1 + c )

Solve for a

=> a = T/(1 + c)

So yeah something like:

; Maths Test

$T = 100
$c = 0.025

$a = $T / (1 + $c)

ConsoleWrite ($a)

works fine.

But it got me thinking, what if you don't have Excel and don't know the formula (i.e. a very complex equation that will do your head in).

Here at work only the top top managers have work stations with Excel installed, the rest of us plebs are running Open Office and it'll be a pain to write all the code to open the Open Office Calc spreadsheet, run the goal seek, and scrape the result back into the GUI.

Also my algebra is okay but not amazing... I'm no maths professor ;-) Thus I was hoping for a Goal Seek UDF... and if no one has done it, I was wondering how hard would it be to code for? Certainly the Micro$oft coders must have some code they run in Excel that can be duplicated for in AutoIt.

Kind regards,

-icu

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

There are some linear equation solvers in AutoIt, but for other equations you will have to use some approximation method.

Edit: Newton's method:

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0