I have a question regarding the functions inside the parts list and BOM fields.

I have created a new field for part length (typical shipping length e.g. 240" for an A36 W-Beam).
What I would like to do is create a formula to calculate the actual part total and output the number of beams I need to order.

For example:
I have six W Beam parts of varying lengths and the total length of those parts come to 220". What I would like the function to do is take that total of 220 and divide it by the shipping length of 240 to give me an estimate of how many full length beams I need to order.

Now to add a twist to this formula, IF the BOM Units are inches, I want the formula to calculate the percentage. IF the BOM units aare set to EACH, then I just want the total number of items needed (example (Bolts, Nuts, Washers, etc...).

Anyone have anything like this set up?

I know the output would need to be verified (since we do NOT weld structural members together end to end here) so if I had two beams of 130" and three beams of 30 inches I know I need to order a minimum of two pieces of steel.
Thanks in advance!
Mark