How to constraint a sum so that the inputs do not exceed the total entered previously?

Welcome to the community, @theo27! This final line added highlighted in yellow should help you achieve what you intend to:

Reference XLSForm:

Constraint Example.xlsx (10.9 KB)