"Goal Seek"ing a Pro

prideaside

New Member
Joined
Feb 18, 2017
Messages
3
Hi there,

Hoping one of you geniuses can help me out here.

What I need to find is "x" in the equation:
.1 = [b + (x*c)]/[a+x]
where "a", "b" & "c" are all numbers based on other formulas that happen in the sheet, so they are always changing but fixed at the time of finding "x".

To put that equation into words:
10% = [rejected_files + (files_to_deliver x rejection_rate)] / [delivered_files + files_to_deliver]

So essentially I need to find how many files I can expect to deliver before hitting the 10% rejection threshold. This gets factored in with a bunch of other file types with their own rejection rates ("rejected_files" and "delivered_files" are sums of all file types - 10% being the overall rejection rate) and I'll need to do this for all of them, but if I get one I can get them all.

I've been trying the Goal Seek with the following code (updating automatically whenever "Worksheet_Calculate"):
Code:
Private Sub CheckGoalSeek()
    Static isWorking As Boolean
    
    If Round(Range("T1").Value, 6) <> 0 And Not isWorking Then
        isWorking = True
        Range("U1").Value = "0"
        Range("T1").GoalSeek Goal:=0.1, ChangingCell:=Range("U1")
        isWorking = False
    End If
End Sub
...where "T1" is the ".1" or "10%" and "U1" is the "x" I'm looking for (other cells between those complete the formula), but while it sometimes gives me the answer I'm looking for it also sometimes gives me wild answers.

I think if I can force Goal Seek to use integers in the changing cell it might give me what I'm looking for (can't deliver half a file). I've factored in ROUNDUP in reference to the changing cell which improved it a little bit, but still gives me many of the same problems. Solver doesn't want to solve this for me.

So what do you think? Any ideas out there? Also, if you can figure that out, maybe you can add this into it... I'd like the number returned to be the highest possible number to make the target cell <= 10%.

Thank you!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi MickG,
That's actually very close, but there's one problem (and it's my fault for not mentioning this in the novel I wrote)...

In my equation:
.1 = [b + (x*c)]/[a+x]
I should have written:
.1 = [b + (ROUNDUP(x*c,0))]/[a+x]

Since there's no such thing as delivering or rejecting a fraction of a file, this ROUNDUP throws a wrench into the math.
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,960
Latest member
AKSMITH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top