This adding amplifier with the operational LM324 is from the SGS integrated circuits manual of 1982. The formula next to the diagram is valid for the input configuration shown. The power supply must be symmetrical.