Once you get the knack of formatting documents down for both print and e-books, it's relatively inexpensive. For print, CreateSpace has a blog with instructions to set up, but in Word, it's simply a matter of taking your text down to 11 pt Times New Roman or Book Antiqua, the page margins to .5 and a gutter of .3 and section breaks between Chapters. Use books from your favorite author as a template. Include a header (different header and footer) with your name on one page and the title on the other. Use your favorite author's books as a template. CreateSpace requires you to purchase a 'proof' copy, to check to make certain your book meets your expectations. With the $39.00 fee for their Pro program of distribution, it only cost me about $50-60 per book to set up. Smashwords offers a similar program through Wordclay but had an additional charge to format your cover art while CreateSpace let me use my own. Back to cover art in a minute.
For e-book formatting take the gutter, header and any page numbering out. Insert either the back cover information or a short excerpt from your book, then your cover art, a generic copyright disclaimer (Smashwords has a great sample) and then a listing of your other books (or those coming soon). This makes the book look more professional. Some e-book formats require you to use section breaks between each of these sections and I advise using them. Take advantage of any previews they offer and edit for appearance on the fly by making the change and saving. Then upload the doc to the appropriate sites - Kindle Direct Publishing (Amazon), PubIt (B&N) and/or Smashwords. Cost? A small percentage of the proceeds.
One consideration - editing. Even the best of self-editors still needs another set of honest eyes on their manuscript. That can and should be an editor - but they can be expensive. (Apologies to all my editor friends out there.) If you can't afford one, try asking at the local community college for their English class, and ask the professor if they'll offer editing it as extra credit. Don't give it to the creative writing folks, they may critique it more than edit it. Lacking that option, recruit beta readers - volunteers who will read your writing for free - but they have to be totally honest with you... and you have to listen!
ISBNs - (international standard book numbers) were provided free when I formatted my books through CreateSpace (for print) and Kindle (for e-book), as both do take a larger cut of the total proceeds. B&N doesn't require them and they were provided free through Smashwords as long as Smashwords was listed as the publisher. The rights, though, still belong to you, the author.
Cover art requires a little creativity but if you're a reader (and you must be if you write) you have lots of samples around you in the books you've read. Find one similar to your writing style and look for art like this. (Google can help you here. Just google the description, and go to images. Double clicking will take you to the site where it's available.) The covers for several of my novels were provided by photos I purchased for about $10.00 from photo sites like Dreamstime and 123rf. Many fantasy artist do charge more. One of my most beautiful covers, for Not Magic Enough , I purchased for $60.00 from a wonderful artist I found on the web, adding text from a free program called Picnik, available from Google. (DO NOT USE ART FOUND BY GOOGLE unless there is no disclaimer for copyright, and you have checked with the site for copyright.) I purchased the cover for The Coming Storm for three credits, about three dollars, from a website called Dreamstime. Each cover is perfectly evocative of the stories contained within them. It did take some time to find them and a few false starts, but the advantage is that no one knows your stories as well as you do so you can find just the right cover art for your book. Format the cover art to 5 X 8 in Picnik, that will cover most trade paperback books, the going size for most print books, and is easily adaptable in e-books.
So all told it cost me between $59.00 for The Coming Storm (free web from Yola, $10.00 cover art, approximately $10.00 w/shipping for proof copy and $39.00 Pro program) to $90.00 for Not Magic Enough. (1/3 the cost of my webpage once I upgraded and 60.00 for the cover art. E-book only). All my books are available in all e-books formats thanks to Kindle and Smashwords, and two (soon to be three) books are now available in print via CreateSpace.
I wish all of you good luck with your writing!