'Say what you want about long dresses, but they cover a multitude of shins.' ~Mae West
Formal wear isn't always a popular topic. Some of us enjoy dressing up, some don't. Either way it's a safe bet that even if you've avoided it thus far, at some point someone in your life is going to get married or die, and for both those situations you'll need the appropriate garments. Of course you can choose not to go to the events that mark these milestones, but that wouldn't be very nice, now would it? So let's get to work and get you ready for any formal occasion that may cross your path.
Assuming you don't want to spend a great deal, I have to point out that not bothering to think about this until the need arises is a very bad idea. 9 times out of 10 you'll wind up at the last minute throwing way too much money at it because you're just out of time, which means you risk being stuck with overpriced garment/s that you may not be crazy about… all because you were in such a hurry. So let's look at how you can avoid that particular little trap. I solemnly swear I'll do my best to make this as painless a process as possible.
First determine your needs. How often do you do formal events? Once every 2 years? Twice a month? Somewhere in between? What types of events are you likely to attend outside of weddings or funerals? What are you expected to wear to such events? Some people really don't do formals very often, and would do well with a couple of separates that can be changed up with accessories according to need. Others have events to go to on a regular basis- maybe it's work related, and they see the same people over and over and thus need a fairly large and serious selection. Or they're lucky enough to have a social life that calls for the same. Your needs have to be viewed within the context of your budget too; my belief is that you should spend the bulk of your money on what you wear the most- whatever you wear on a daily basis. So it follows that if you fall in the once-every-two-years category you shouldn't spend a great deal of your budget here. If however, you have a lively social life including lots of formal occasions (lucky you!) then you'll want to allocate more of your clothing budget towards it.
After figuring out how much you think you should have, then taking stock of what you already have, you need to decide what to add. A couple of things to keep in mind; first, if your weight tends to yo-yo a little bit, then either focus on things that can be worn at either your heavier or lighter weight- very good quality knits or bias cut garments are are a good way to address this- or make peace with having to have two formal wardrobes. Second, if you have a micro-budget then you may need to be more open minded and think 'outside the box,' as they say. If that's the case then you'll do best to look for either very, very classic styles that won't become outdated, or go completely the other way- perhaps vintage styles, or strong, eclectic pieces that are 'timeless' exactly because they're so far 'outside the box.' (Bonus: here's an opportunity to express your style to the fullest.)
Regardless of your budget start by looking at the very best stores in your area; you don't have to buy, but do keep in mind that all retail stores have regular sales. If nothing else, try on what you like to get an idea of what looks best on you, and then you'll have a standard to measure by. If you see something you love check when they'll have sales, mark it in your calendar and go back to look when the sale is happening. Also consider consignment shops- these are likely to have some very nice pieces in nearly perfect condition, and you may be able to negotiate price. Last and definitely not least, also look at thrift shops. This is where you're more likely to find the 'eclectic' pieces; vintage, or designer pieces that may need some TLC that would be worth the investment. Also keep online resources in mind- Ebay, for example, can be a good option if you don't mind the potential hassle of returning things by mail and other associated risks.
The trick with this is to start early and keep at it. Start looking as soon as you've decided what you need. Schedule regular trips to shop- for this to work you absolutely have to look on a regular basis. At the retail stores and consignment shops you may want to see if you can leave your name and number with someone along with a description of what you're looking for, and have them contact you when something that might work comes in. But go on a regular basis anyway- you never know when you'll find something else on sale that might work just as well. The point of all this dedicated hunting is to find what you need and what makes you look your very best for next to no money. Or at least a whole lot less. We all want the most for our money, and the only way to get that is by being careful and planning ahead.
This approach works well regardless of whether you're one who needs very little formal wear or quite a lot. If you need only the minimum you can take more time between shopping trips; if you need more, you can schedule weekly trips.
Also, one nifty trick is to catalogue what you have. Spend a little time trying your things on and see how many different combinations you can create with your basic pieces and various accessories, then photograph these combinations. Now hang these photos on the hangars with the pieces so that when the occasion arrises you'll have more options at your disposal. You can also write on the back of each photo when said combination was worn to avoid repeating yourself too often.
One of the best parts about this approach is that it gives you the time to ensure you've picked pieces with flattering design lines and colors, and that reflect your aesthetic- which means you'll look and feel your best.