Jump to content

Anything like Goal Seek in AutoIt?


 Share

Recommended Posts

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...