At the close of the second quarter of 2018, median home prices in five Bay Area counties hit $1 million or more. What does it take to buy a home in these areas, and where in the Bay Area can buyers find something for half that price?

Compass Realty just released its second quarter report on the state of Bay Area real estate. According to this study, both San Mateo and San Francisco counties reached a median selling price closer to $2 million than $1 million.

Santa Clara, Marin, and Alameda all fetched a median of $1 million or more.

The least expensive county is Solano, where the median is now $450,000. This means that Solano County home values have gone up approximately percent year-over-year.

Zillow Real Estate predicts that this county will continue to rise, gaining almost another 9 percent in the coming year.

The Compass report is quick to mention that median prices aren't always the best measure of a market, since the figure is meant to show the mid-range of sales prices. Half as many homes sold for more, and half sold for less.

However, the new figures do indicate serious issues for affordability.

How much do you have to make to buy a home in the Bay Area?

Based on a 20 percent down payment, local taxes and insurance, buyers in both San Mateo and San Francisco offer a qualifying income close to $350,000. In Santa Clara and Marin, $300,000 will do.

And for Solano, buyers need $95,380 a year in qualifying income. The most recent Census data tell us that "Households in Solano County, CA have a median annual income of $73,900."

Dismal affordability

The California Association of Realtors posits the mismatch between home prices and salaries has a dramatic effect on affordability.

In Santa Clara and San Francisco, only 14 percent of residents make the qualifying income to buy a home. In Alameda, it's 16 percent. Solano has one of the higher pay area percentages: 38 percent can qualify to buy a home.

However, the report also mentions these figures don't take into account recent political changes. Federal income taxes limiting the deductibility of property taxes and the mortgage tax credit could make for even less affordability.

The mystery

Despite being out of reach for more than half its populace, the average days on the market for Santa Clara properties is 19. In San Francisco, that range is 30 to 40 days. In January of 2018, Solano County made news for being the nation's third hottest real estate market.

So if not affordable to half or (way more) than local residents, who is buying Bay Area real estate so quickly, and at such prices?

Anna Marie Erwert writes from both the renter and new buyer perspective, having (finally) achieved both statuses. She focuses on national real estate trends, specializing in the San Francisco Bay Area and Pacific Northwest. Follow Anna on Twitter: @AnnaMarieErwert