Loop division to find Yeild (1 Viewer)

dgaller

Registered User.
Local time
Today, 02:33
Joined
Oct 31, 2007
Messages
60
I am working a database to price jobs involving lumber. One of the first things I need to do is come up with a function to determine the yield.

Example: Form![Yeild]![length] = 10.5 inches and Form![Yeild]![QTY]=12 and Form![Yeild]![Boardlength]=92.

Previously in Excel I would Multiply, Boardlength-(length*X) manually increasing x until i got a negative number. The remainder would be my drop then I could divide x/[qty] to get how many boards I need.


Can someone assist with a function to do this.
 

stopher

AWF VIP
Local time
Today, 07:33
Joined
Feb 1, 2006
Messages
2,395
You can calculate how many times length goes into Boardlength as follows:

x = INT(Boardlength-length)

So boards needed = INT(Boardlength - length)/qty


In your example x = INT(92/10.5) = INT(8.76) = 8

So boards needed = 8/12 = 0.666

hth
Chris
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:33
Joined
Sep 12, 2006
Messages
15,755
the biggest problem on stuff like this is reducing waste.

if you need to cut variable lengths from your boards, and you want to minimise the waste (offcuts) that's when it gets tricky!

----
stopher. maybe I am misunderstanding

if you need 12 lengths of 10.5 ins - and the board length is 92, then the maximum lengths you can get from one board is 92/10.5 = 8.

so to get 12 lengths you need 12/8 boards = 2 (rounded up)

you are dividing 8/12 aren't you?
 

dgaller

Registered User.
Local time
Today, 02:33
Joined
Oct 31, 2007
Messages
60
Thank you. This is much simpler than I was making it. My only change is I think the end is 12/8 =1.5?
 

stopher

AWF VIP
Local time
Today, 07:33
Joined
Feb 1, 2006
Messages
2,395
stopher. maybe I am misunderstanding

if you need 12 lengths of 10.5 ins - and the board length is 92, then the maximum lengths you can get from one board is 92/10.5 = 8.

so to get 12 lengths you need 12/8 boards = 2 (rounded up)

you are dividing 8/12 aren't you?
Probably :confused: I was just following the formula provided by OP.
 

Users who are viewing this thread

Top Bottom