#### prideaside

##### New Member

- Joined
- Feb 18, 2017

- Messages
- 3

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
```

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!