sandwichgenYou may find yourself parenting in two directions—financially responsible for both your children and also your aging parents.

If you’re in the middle of this generational sandwich, know that you’re not alone.

In fact, according to the Pew Research Center, about one in seven or 15% of middle-aged adults is providing financial support to both an aging parent and a child.

The reason? Adults in the sandwich generation are having children later in life; meanwhile their baby boomer parents are living longer and may have diminishing health,  thus their parents’ medical care expenses are being passed down and becoming their responsibility.

Supporting both your parents and children can be overwhelming, but there are tax rules that may benefit you to make the most of your situation. Provided all tax eligibility requirements are met, you may be able to claim both as dependents on your tax returns. Doing so can result in a valuable tax deduction for you.

Here, we offer tips to help you determine if you might be able to take advantage of this benefit.

Claim Your Parents as Dependents

If you provide over 50% of the financial support for your parents, the Internal Revenue Service (IRS) may allow you to claim them as dependents on your tax return.

Unlike when you claim young children as dependents, it is not necessary for your elderly parents to be living with you.

In order to claim your parents as your dependents, they must first meet income requirements for “qualifying relatives” set forth in the IRS’ annual Publication 501, Exemptions, Standard Deduction, and Filing Information.

Evaluate Your Parents’ Income Eligibility

According to the IRS, your parent must not have earned or received more gross income than the exemption amount for the tax year ($4,000 for tax year 2015). This amount is determined by the IRS and may change from year to year.

When evaluating your parents’ gross income, you should generally include the following income sources: dividends, capital gains from the sale of stock, interest earned in a bank account, and other passive investments, such as income from rental properties owned. You would not include their non-taxable income received from Social Security benefits and other tax-exempt pensions.

A Support Test Clarifies What You Pay, Not Your Parents’ Ability to Pay

Not only must parents satisfy the income guidelines, but you must also provide more than half of their financial support during the tax year in order to claim them as dependents.

To check your level of support, you can complete a comprehensive evaluation of your parents’ expenses. The support test distinguishes who actually pays rather than your parents’ ability to pay.

For example, if your parents use their Social Security benefits to pay for a monthly mortgage payment of $500, and you pay for their expenses exceeding $500 per month, then you would likely satisfy the IRS’ support test requirements, even if your parents put thousands of dollars of tax-exempt income into a savings account each month, according to Intuit.

If you share the financial burden of looking after your parents with another or more siblings, then the IRS eligibility rules can become even more nuanced, and you may wish to consult a tax professional for help.

Help Your Parents Minimize Taxes on Their Investment Withdrawals

If your parents are relying on their investments for income in retirement, then you can also help them minimize their related taxes. The order in which they withdraw money from their investment accounts can impact how long their portfolio lasts in retirement.

Because taxes will likely be one of their largest expenses in retirement (on par with healthcare), a smart withdrawal strategy can be crucial to their retirement success.

In general, they should consider first withdrawing from taxable accounts, then tax-deferred accounts such as Individual Retirement Accounts (IRAs) or 401(k)s, and lastly, tax-free accounts, such as Roth IRAs and Roth 401(k)s. You can help them adjust this strategy if there are any income and tax bracket fluctuations throughout their retirement years.

Claiming Your Adult Children as Dependents

If your children are 19 to 24 years old and full-time college students for at least five months of the year, qualifying relative exemptions are yours for the taking, so long as you provide at least half of their support.

This requirement may be easy to satisfy if you’re already paying for their college education and room and board, because the combined amount likely makes up more than half of the funds supporting them.

Claiming children as dependents after they graduate from college, however, gets a little more complicated. In order to claim children who are no longer full-time students, they must have lived with you for more than half the year, and they must also satisfy the same qualifying relative criteria as elderly parents, mentioned earlier.

And remember that if your children earn income that exceeds the total exemption amount ($4,000 in 2015), you won’t be able to claim them as dependents.

Your Tax Benefits Will Vary

For both parents and children, keep in mind that although the dependency exemption is fairly sizable, it’s a deduction from income and not a credit against your taxes.

The actual deduction value depends on your tax bracket. For example, at the 25% tax bracket (taxable income from $70,700 to $142,700 for couples filing jointly for tax year 2015), a $4,000 exemption equates to a tax deduction of less than $1,000.

Of course, any amount can help, especially if you’re in the middle of supporting both older and younger generations, so it’s worth taking advantage of this tax benefit if your parents and children can qualify.

As with any complex tax concept or calculation, we suggest you discuss your personal circumstances with a tax professional.

This article is intended for educational purposes, but not intended to be relied upon as tax advice.

More from Betterment: