I'm hoping that someone has a formula for calculating the portion of Social Security benefits which are taxable. If you don't, but would be willing to try to create one, here are the basics. There are three levels of Provisional Income, which is defined as non-Social Security income plus half of Social security benefits (you probably don't need to know this to create a formula). The levels are:
Less than $32,000
$32,000 to $44,000
More than $44,000

To simplify my request, let's assume Provisional Income is always more than $44,000.

Calculating the taxable Social Security income when Provisional Income is more than $44,000:
Lesser of:
1) 85% of Social Security benefits OR
2) 85% of Provisional Income above $44,000 plus the lesser of:
a) $6,000 OR
b) 50% of Social Security income

Here are two examples:
1. Provisional Income of $60,000 and Social Security benefits of $30,000. Option 1 produces a value of $25,500 and option 2 produces a value of $19,500 [60-44=16 x .85=13,500 + 6]. So, option 2 should be used.

2. Provisional Income of $82,500 and Social Security benefits of $25,000. Option 1 produces a value of $21,250 and option 2 produces a value of $38,725 [82.5-44=38.5 x .85 = 32.725 + 6]. So, option 1 should be used.

Please let me know if additional information is needed.

Thank you for your help.