If your plans involve more Solo cups than champagne flutes, go ahead and wear a sweater and jeans. Opt for a knit with a cool print like this one, and crisp white denim instead of standard blues. You'll stand out without looking try-hard.
Don't bother buying a gown you won't wear more than twice a year (max?) anyway. Rent one instead, and splurge on a really fabulous one like this Jennifer Lawrence-approved style. (You'll get to tell everyone you're wearing Calvin Klein, which is always fun. Or so I imagine.)
For in-between dress codes, mix a fancy pair of pants and a sharp jacket with a more casual element or two: a t-shirt, maybe, or perhaps some flats. That sort of eclectic mix is perfect for so many occasions.