was going through conference call of vishay. some points.
Automotive also in 2018 has been the main driver of growth in our industry. Growth in electronic content assures increasing volume of components despite a flat vehicle production in 2018.
Coming to our main product lines, starting with resistors and inductors. Vishay’s traditional and since years, most profitable business continues to grow steadily. With resistors and inductors, we enjoy a very strong position in the industrial, auto, mill and medical market segments. Sales in the Q4 were $262 million, up by $11 million or 4.5% versus prior quarter and up by $50 million or 23% versus prior year, excluding exchange rate impacts. The acquisition of UltraSource contributed $5 million in the quarter. Year-over-year resistors and inductors grew remarkably from $839 million in 2017 to $1.012 billion in 2018 or by 18% again excluding exchange rate impacts. UltraSource contributed $17 million year-over-year.
Book-to-bill in Q4 was 0.94 after 1.02 in prior quarter. Backlog decreased slightly from 5.2 months to 5.0 months, still extremely high backlog. Gross margin in the quarter came in at 32% of sales, after 34% in prior quarter. Gross margin was impacted by inventory reduction, higher repair and maintenance costs and a less favorable product mix. Gross margin for the year 2018 was at fairly excellent 33% of sales, up from 30% the year before. Inventory turns in the fourth quarter improved to a good level of 4.4 as compared to 4.4 for the entire year 2018. Prices went up by 0.4% versus prior quarter and by 0.5% versus prior year. UltraSource proves to be a successful and profitable acquisition, strengthening further our position in thin film networks.
Overall book to bill seem to be coming down for Vishay.