Check out the 10-k here:
http://www.microsoft.com/investor/SEC/default.aspx
That's Microsoft's annual report. If you go to item 6, financial highlights, you'll see that in 2013, They had net income of $21.863 billion. Net income is the excess of revenues over outlays in the year (including depreciation and other non-cash expenses). This is another way of saying Microsoft ran a surplus of $21.863 billion.
Yet, scroll down. "notice that "long-term obligations" rose? See page 36 for an explanation. Microsoft issued new debt to take advantage of low interest rates. If you think that, by definition, Microsoft didn't run a surplus because its debt rose, then you're using an invented definition of the term that isn't shared by any professional stock analysts, accountants, bankers, financiers, etc. A company, an individual, or a government can increase its outstanding debt in a year with a surplus, if it chooses to, which it may do for all sorts of reasons. Nobody says you have to devote a surplus to paying down debt (as opposed to building up cash reserves or buying up assets).
Now, picture it in the government context. Let's say that in 2000 we had a bunch of extra cash, as a nation. And let's say we had outstanding debt that we were paying 10% on (long-term treasuries we'd issued in the days of high interest rates), and we had the ability to sell treasuries at 5%. So, let's say that we used that extra cash to buy up some of those old high-rate treasuries and put them into government accounts (like the Social Security trust fund). And let's say we also issued some new long-term debt at 5%, in order to finance buying up even more of the old high-rate debt that was at 10%. Now, because of the way government accounting works, those old treasuries will still count as debt, even though they're held by the government, in government accounts.
Now, just to simply things, I'll state things in terms of smaller, human proportions: Let's say you owe $50,000, on a 20-year loan, at 10% interest with no pre-payment option (even if interest rates drop, you're stuck paying at that rate for the full 20 years, unless the other party agrees to a change). And let's say that the other side agrees to sell you back that note for $75,000, up-front. And let's further say that because interest rates have dropped, you can raise that $75,000 by borrowing money at a 20-year 4% fixed interest rate. And let's say you choose to do so.
Now, on paper, your debt has risen by $25,000, right? You used to owe $50,000, and now you owe $75,000. But was this a bad move? Of course not. Over the course of 20 years, with annual compounding, you'd have paid $286,375 in interest on that $50,000 loan, if you'd been stuck with that 10% interest rate. By comparison, at 4%, you'll pay $89,334 in interest over the course of 20 years. Even after considering the extra $25,000 in principal, you come out $172,041 ahead for having refinanced that way. It's that kind of math that causes many people, companies, and governments to increase borrowings even in years when they're running a surplus, if credit markets are such that they can refinance old debt at significantly lower rates.
Now, see here:
http://www.treasurydirect.gov/NP/debt/search?startMonth=09&startDay=30&startYear=1999&endMonth=09&endDay=30&endYear=2000
That shows the change in the debt from the last day of FY 1999 to the last day of FY 2000 (government fiscal years start on October 1). As you'll see, total public debt outstanding rose -- which is the thing you're basing your argument on. But look at the other two columns. You'll see government debt held by the public fell considerably, with the difference being the debt held in "intragovernmental holdings." In essence, what happened is what I was talking about earlier. The government ran a big surplus (revenues outstripping spending). So, it bought up some outstanding debt, previously held by the public, and put it into government accounts (where it still counted as debt, but showed up under the intragovernmental holdings heading). Those treasuries still existed -- they'd continue to exist until they reached their maturity date-- but it was now money the government owned to itself, rather than owing it to investors... primarily money used to bolster the Social Security trust fund. Meanwhile, with interest rates having falling greatly since the eighties, and some of that old debt still circulating, the government issued new, low-rate debt to use to finance the purchase of old high-rate debt, reducing what taxpayers would wind up having to pay to bondholders over the long haul.
That's how debt rose during a year when every knowledgeable person admits we had a surplus.