How do I work out to amount out for interior paint amount needed? Want to paint interior walls and ceilings of my house and want...

Want to paint interior walls and ceilings of my house and want to know what formula to use to numeral out how much paint I iwill need
Answers:    example for walls and ceiling:

1600 sq ft of surface x 2 coats= 3200 divided by 400=8 gal.

example for trim: for 4" of trim x 12' multiply .75 x 12'= 9 sq ft.
add up the amount of square footage for adjectives trim and follow the first formula.
Width of the wall times height equals square foot.