This paper studies many-to-one matching markets in which each agent’s preferences not only depend on the institution that hires her, but also on the group of her colleagues, which are matched to the same institution. With an unrestricted domain of preferences the non-emptiness of the core is not guaranteed. We present some conditions on agents’ preferences which determine two possible situations. In both situations, at least one stable allocation exists. The first one reflects real-life situations in which the agents are more worried about an acceptable set of colleagues than the firm hiring them. The second one refers to markets in which a workers’ ranking is accepted by workers and firms in that market.