Method for combined respiratory gas analysis and lung function testing by means of a device, wherein the device comprises the following features: - a first combined inlet/outlet opening, - a second combined inlet/outlet opening, - a gas quantity measuring device (66, 70) for determining an amount of the respiratory gas flowing through, - a gas analysis device for analyzing the respiratory gas, - a multiway valve which can be brought at least between a first valve path combination (A, B, C, D) and a second valve path combination (A, B, C, D), wherein - with the first valve path combination (A, B, C, D) of the multiway valve, while circumventing the gas analysis device, a first gas path can be established between the first combined inlet/outlet opening, the gas quantity measuring device (66, 70) and the second combined inlet/outlet opening, and - with the second valve path combination (A, B, C, D) of the multiway valve, a second gas path can be established between the first combined inlet/outlet opening, the gas analysis device, the gas quantity measuring device (66, 70) and the second combined inlet/outlet opening, wherein the method comprises the following steps: - establishing the first gas path, - inhaling by flow of air from an external space through the second combined inlet/outlet opening along the first gas path in the direction of the first combined inlet/outlet opening, - exhaling for lung function testing in order for respiratory gas to flow through the gas quantity measuring device (66, 70) along the first gas path from the first combined inlet/outlet opening in the direction of the second combined inlet/outlet opening, - establishing the second gas path while carrying out the preceding step, - conducting the respiratory gas, which is flowing through, along the second gas path through the gas analysis device in the direction of the second combined inlet/outlet opening, and - flushing the gas analysis device by conducting air from the external space from the second combined inlet/outlet opening along the second gas path through the gas analysis device in the direction of the first combined inlet/outlet opening. - a first combined inlet/outlet opening, - a second combined inlet/outlet opening, - a gas quantity measuring device (66, 70) for determining an amount of the respiratory gas flowing through, - a gas analysis device for analyzing the respiratory gas, - a multiway valve which can be brought at least between a first valve path combination (A, B, C, D) and a second valve path combination (A, B, C, D), wherein - with the first valve path combination (A, B, C, D) of the multiway valve, while circumventing the gas analysis device, a first gas path can be established between the first combined inlet/outlet opening, the gas quantity measuring device (66, 70) and the second combined inlet/outlet opening, and - with the second valve path combination (A, B, C, D) of the multiway valve, a second gas path can be established between the first combined inlet/outlet opening, the gas analysis device, the gas quantity measuring device (66, 70) and the second combined inlet/outlet opening, wherein the method comprises the following steps: - establishing the first gas path, - inhaling by flow of air from an external space through the second combined inlet/outlet opening along the first gas path in the direction of the first combined inlet/outlet opening, - exhaling for lung function testing in order for respiratory gas to flow through the gas quantity measuring device (66, 70) along the first gas path from the first combined inlet/outlet opening in the direction of the second combined inlet/outlet opening, - establishing the second gas path while carrying out the preceding step, - conducting the respiratory gas, which is flowing through, along the second gas path through the gas analysis device in the direction of the second combined inlet/outlet opening, and - flushing the gas analysis device by conducting air from the external space from the second combined inlet/outlet opening along the second gas path through the gas analysis device in the direction of the first combined inlet/outlet opening.