You would have to go thru in an excel spreadsheet and make a list of all your ingredients, how much you paid, and then break it down per some amount (like a cup, tablespoon, etc). Then you have to type in your recipe and use the $amount for each item and multiply it by the amount of flour, sugar, etc. Add up all your costs. Don't forget there's a water bill, electricity, etc. Then you will have to determine how many cupcakes you yield. Plus, how much do you want to charge for your time. Then you will know if you are making a profit.
To be honest, it doesn't cost much to make. I think it costs about $2.50 for me to make a scratch cake (not including electricity or anything else). With frosting and the liners it would probably be 5-7. But if I get 36 cupcakes out of that (or more)...(at .75/ cupcake that would be $27.00).
Hope my rambling has helped!