There are two functions: $\frac{32-x}4=y$ and $\frac{48-x}2=y$
For instance, if the two $x$s are $18$ and $24$, the two $y$s will be $3.5$ and $12$. I would like to add the two $x$s and two $y$s: $18+24=42$, $3.5+12=15.5$.
How can I merge the two functions into only one so that I set the $x=42$, I can directly get the $y=15.5$?
You have the two functions $$y_1 = (32-x_1)/4 \\ y_2 = (48-x_2)/2$$
Adding them together gives
$$y_1+y_2 = (32-x_1)/4 + (48-x_2)/2$$
which can be simplified to
$$y_1+y_2 = (128-(x_1+2x_2))/4$$
or
$$Y = (128-X)/4$$
where $Y=y_1+y_2$ and $X=x_1+2x_2$.
This is not a function of $x_1+x_2$, which you wanted, but it is a function of $x_1+2x_2$ instead. So for your example, instead of an input of $18+24=42$ you will have to use an input of $18+2*24=66$ to get your answer of $15.5$.