For dividend investors, AT&T (T 2.30%) stock may seem like one of the best options simply because of its tantalizing 7.4% dividend yield. However, there is more to a company than just how much of a dividend it pays.

While I think AT&T stock is a great buy for a couple of reasons, there are also a few that make me want to avoid it altogether. But which factors are more important in this investment? Read on to find out.

Reason to buy No. 1: The dividend appears safe

Normally, when dividend yields rise about 4% or 5%, investors worry that the company can't fund the dividend. However, that doesn't appear to be the case for AT&T.

Investors can analyze how safe a dividend is by dividing its payout by an earnings metric like earnings per share (EPS) or free cash flow (FCF). This is called the dividend payout ratio, but there are some caveats.

Over the past 12 months, AT&T's payout ratio, when analyzed from an EPS perspective, is negative 93%, meaning AT&T paid out way more in dividends than it brought in. This is a red flag, but it's not fair to AT&T. In the fourth quarter of 2022, AT&T wrote down a lot of assets, which drove its net income into the negatives. If you subtract that quarter, AT&T's payout ratio by quarter looks like this:

Quarter EPS Dividends Paid Payout Ratio
Q3 2022 $0.80 $0.2775 35%
Q4 2022 ($3.20) $0.2775 (1,153%)
Q1 2023 $0.57 $0.2775 49%
Q2 2023 $0.61 $0.2775 46%

Data source: AT&T and Nasdaq.

It's OK to ignore that quarter because the losses sustained in Q4 were paper losses. If you do, then AT&T's payout ratio looks healthy.

Reason to buy No. 2: The stock is cheap

Another item to analyze when buying a stock is its valuation. Because AT&T is a mature company, I'll use its price-to-earnings (P/E) ratio. At 6.8 times earnings, the stock looks pretty cheap. But it's difficult to tell because AT&T's EPS is quite cyclical.

Another way to value the company is by free cash flow (FCF), which isn't as volatile as EPS can be. From this perspective, AT&T is nearing a two-decade low.

T PE Ratio Chart

T P/E Ratio data by YCharts.

With AT&T reaching a level not seen for many years, it may appear to be a buy.

However, many investors have been burned by buying stocks on valuation alone.

Reason to avoid No. 1: AT&T uses a lot of debt to grow

For most of the past decade, interest rates were at historic lows, allowing companies to use cheap debt to grow. Now that interest rates are up again, this practice has become much more expensive.

AT&T already has $136 billion in debt, which has steadily risen over the past two decades. Additionally, how much it pays to service the debt has also increased, as it now takes $6.3 billion annually to pay the interest.

T Total Long Term Debt (Annual) Chart

T Total Long Term Debt (Annual) data by YCharts.

With new debt not on as great of terms, one of two things will happen. First, AT&T continues to take on debt at its current pace, and its interest expense grows so much that it cannot fund its dividend. Second, AT&T doesn't take on debt and struggles to grow, which causes earnings to shrink and requires the dividend to be decreased.

That's not a rosy picture for shareholders, and it's a consideration investors should weigh.

Reason to avoid No. 2: AT&T has lost to the market over the long term

Over the past decade, AT&T has been one of the worst stocks to own that hasn't been wrapped in a bubble. Even with dividends added in, the stock has significantly underperformed the market over the past decade.

T Total Return Level Chart

T Total Return Level data by YCharts.

No matter the period, AT&T hasn't been a winning stock pick.

Period AT&T Total Return S&P 500 Total Return
1 Year 2% 22%
3 Year (14%) 34%
5 Year (14%) 60%
20 Year 265% 518%

Data source: YCharts.

This trend doesn't breed confidence in me as a shareholder, as my goal is to beat the market over the long term.

So, what should investors do with the stock? It all depends on your goals. If you're a younger or middle-aged investor with a longer investing horizon, AT&T looks like a stock to avoid due to its long-term underperformance. However, if you're a dividend-seeking investor, AT&T stock may not be a bad buy here because of it being cheap and the dividend staying safe. However, if the stock price rebounds, it may be time to sell, as the historical trend for AT&T's stock has been downward.