What effect does stellar granulation to have on a chemical analysis of a star's spectrum? The spectrum from stellar granules will obviously be for hotter gas, while the spectrum from the lanes between them will be for cooler gas.

Does this &quot;average out&quot; so that an average temperature distribution can be used for a metallicity analysis?
Will the spectroscopic effects be the same for all lines?
There is no simple answer to these questions - although I could be brief and say
(i) No it doesn't and (ii) no they won't.
If you make a simple two component atmosphere then the observed spectrum will be the flux-weighted combination of two spectra.
$$ S_{\rm obs} = \frac{A_1 T_1^4 S_1 + A_2 T_2^4 S_2}{A_1 T_1^4 + A_2 T_2^4}\ , $$
where $A_1, T_1, S_1$ are the area, temperature and spectrum of material at $T_1$ and the quantities with subscript 2 are for the regions at temperature $T_2$.
Now, depending on the response of any spectral feature to a change in temperature this could make the equivalent width of that feature become stronger or weaker in the flux-weighted average spectrum. If you then analyse that spectrum assuming that there is a single temperature then what you derive for an abundance based on that feature could get bigger or smaller.
For example most lines of neutral species (e.g. Fe I, Li I) get stronger in cooler atmospheres. If you put cool starspots on a star then the equivalent widths of these lines will become stronger. The average temperature of the star will decline very slightly. The net effect would be to estimate that the abundance of iron or lithium in that star was larger.
On the other hand if the line was very strong such that it was in the saturated part of the curve of growth, then it wouldn't get much stronger in a cooler atmosphere and it could even be that by adopting a lower average temperature, the lack of a significant increase in line equivalent wdth would lead one to infer a reduced abundance.
A more clear-cut case might be lines of ionised Fe II. These would become weaker in a cooler atmosphere, so you would end up inferring a lower iron abundance from the flux-weighted average spectrum.
Then there is the issue of the over-simplification that a simple two-temperature model imposes. Real granulation also involves the movement of plasma with consequent implications for micro- and macro-turbulence and how those affect the line formation and assumption of local thermodynamic equilibrium. These can only be addressed using expensive 3D stellar atmosphere models. Such models do exist and they offer grids of 3D NLTE corrections to abundances determined using 1D LTE atmospheric analyses. The corrections can go in either direction depending on the strengths of the lines and the intrinsic parameters of the star. As an example, Wang et al. (2021) present a grid of corrections for the Li I optical/NIR lines that I have a particular interest in.