A ventilator (1) determines states with cough attacks and an operating method for a ventilator determines cough attacks. It is determined on the basis of pressure measured values (13, 21, 19) and flow measured values (11, 15, 17) whether consecutive elevations of an airway pressure in a ventilator (1) are due to one cough event or due to a plurality of cough events. A plurality of cough events indicates a state of a cough attack. An output (41, 42, 44) of a warning (44) or alarm (42) is issued indicating the state.