### Title

A Calculation

### Post

I'm not a mathematician, nor a filemaker genius, but I do need to figure out how to do this equation...

We produce labels, we need to center the labels on a sheet. Page sizes vary from 8.5x11, 8.5x14, 11x14, 12x18

Variables are:

height and width of each label, gaps between each label, and number of labels down and across.

I need to produce the end result with a left margin and a top margin in fractions of 32nds (rounded up or down so that 12.4/32 is 12/32 and 12.5/32 is 13/32) and an error message if top margin less than .5 and left margin is 0.1875

Fields I am using with explanation -

"Size AC" - Label Width

"Size AR" - Label Height

"Qty AC" - Label Quantity Across

"Qty AR" - Label Quantity Down

"Gaps AC" - Gaps between labels across

"Gaps AR" - Gaps between labels down

"Total Lables" Calculated field (Qty AC x Qty AR)

"Left Margin" Where the calculated left margin goes, but still modifiable for specified margins

"Top Margin" Where the calculated top margin goes, but still modifiable for specified margins

"File Top Margin" - Copy Top Margin but in decimals not fractions

"File Left Margin" - Copy Left Margin but in decimals not fractions and subtract 0.137

File will be posted to brentnelsonmedia.com/filemaker if you want to look at what I am working with. Layout - "Design"

My guess for the formula is (not filemaker correct an any way, but in my mind works)

(Size AR) x (Qty AR) + (Qty AR) x (Gap AR) - (Gap AR) = (Used Area AR)

(Size AC) x (Qty AC)+ (Qty AC) x (Gap AC) - (Gap AC) = (Used Area AC)

(Used Area AC) x (Used Area AR) = (Total Used Area)

Get (Sheet Size)

If (8.5x11); (Top Margin) = 11 - (Used Area AR) /2; (Left Margin) = 8.5 - (Used Area AC) /2;

If (8.5x14); (Top Margin) = 14 - (Used Area AR) /2; (Left Margin) = 8.5 - (Used Area AC) /2;

If (11x14); (Top Margin) = 14 - (Used Area AR) /2; (Left Margin) = 11 - (Used Area AC) /2;

If (12x18); (Top Margin) = 18 - (Used Area AR) /2; (Left Margin) = 12 - (Used Area AC) /2;

But this needs to auto calculate as the fieds are being entered, this is in my mind what a script should look like (not in FileMakers mind I'm sure)