(AP Photo/Orlin Wagner)

Schools matter when buying a home, even for those who don’t have children. 

Homes cost more in quality school districts – about $50 more per square foot in areas with top-ranked schools versus average-ranked schools, according to real estate company Redfin.  (More on that later.) And they typically retain their values better when it’s time to sell.

But that doesn't mean that you can't find a home that's affordable. RealtyTrac has identified 489 Zip codes with elementary schools that had test scores at least one-third higher than the average in their respective states and homes with prices that were no more than one-third of the median household income. These areas had the added bonus of a low unemployment rate.  Here are the areas that topped the list:


Not to worry if you don't see your area above.  Remember the list only represents 4 percent of the Zip codes that meet RealtyTrac's criteria for affordability, great test scores and low unemployment. Also, many states were not included in the study, which relied on home prices from recorded sales deeds.  States that do not require disclosure of the full sales price on a deed were tossed out of the analysis.  More than a dozen states fall into that category, including:  Alaska, Idaho, Indiana, Kansas, Louisiana, Maine, Mississippi, Missouri, Montana, New Mexico, North Dakota, Texas, Utah and Wyoming.

Now for the less affordable.  There are 127  Zip codes with great elementary schools -- again, test scores that were at least one-third higher than the average for their respective states, according to RealtyTrac.  But in these areas, the average price of a home required at least two-thirds of the median household income in the county.  Here's that list:


From the Redfin study, which was released last year, comes the most startling example of how schools affect home prices.  This illustrates how two similar homes less than a mile from one another can be more than $100,000 apart on price based on the school district they're in.