Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Goal Seek
#1
Hello every body , I am trying to replicate the goal seek function in excel . I have 5 formulas that have the same 4 variables that we need to solve for. We have what the formulas should equal . For example purposes we will use 250 . we also have M in the formula that is a known value. All of the A12-A55 values are know values pulled from a matrix table. I need to be able to potentially incorporate this into Tabpy as the values we would have in tableau and then send them forumulas to Tabpy and have it optimize the 4 unknown variables values and send them back .

Lets define the 4 Variables that are unknow that we need to solve for below.
A
B
C
D


250 = [M]+A*[A12]+B*[A13]+C*[A14]+D*[A15]
250 = [M]+A*[A22]+B*[A23]+C*[A24]+D*[A25]
250= [M]+A*[A32]+B*[A33]+C*[A34]+D*[A35]
250= [M]+A*[A42]+B*[A43]+C*[A44]+D*[A45]
250= [M]+A*[A52]+B*[A53]+C*[A54]+D*[A55]

Question 1:how could we write this code in python?
Is Tabpy an option? if so question 2

Question 2: does any body have any idea how we could potentially do something like this utilizing Tableau and Tabpy table extension
Reply
#2
Did you search for something like "excel goal seek python"? I did and saw this:

https://github.com/DrTol/GoalSeek_Python
https://towardsdatascience.com/a-better-...6aff56e9f2
https://pythoninoffice.com/replicate-exc...in-python/
https://bitsofanalytics.org/posts/what-i...lseek.html
...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I am getting a valueError. And not sure why? My goal is to visualize the correlation ReadytoCode 0 509 Dec-11-2023, 05:33 AM
Last Post: ReadytoCode
  I get an FileNotFouerror while try to open(file,"rt"). My goal is to replace str decoded 1 1,430 May-06-2022, 01:44 PM
Last Post: Larz60+
  I am getting an Error, and not sure why? My goal is to print out rahulne22 7 3,114 Dec-01-2019, 03:53 PM
Last Post: snippsat
  offset can not be negative in File.seek()? jollydragon 6 7,072 Sep-28-2019, 03:08 AM
Last Post: jollydragon
  Turning Robot towards goal, comparison of angles SpaceTime 0 2,786 Jan-21-2019, 10:26 PM
Last Post: SpaceTime

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020