The macroscopic dielectric function requires the calculation of optical transition matrix elements. The use of wave functions of the single-particle problem with an effective local potential leads to the equivalence of longitudinal and transverse formulations for the optical transition operator. The advantage of the longitudinal approach is the easy inclusion of effects of spin-orbit interaction and non-localities due to exchange and correlation. The resulting matrix elements depend on the symmetry of initial and final state. The scenario of van Hove singularities to interprete the lineshape of optical spectra is significantly modified by the excitonic Coulomb effects. The excitonic redshift of the optical absorption partly compensates the blue shift due to quasiparticle effects. In addition, a redistribution of spectral strength from higher to lower photon energies and the formation of excitonic bound states occur. The combination of quasiparticle and excitonic effects, despite their treatment within the GW approximation, leads to optical and energy-loss spectra in good agreement with experimental findings. This is illustrated for anorganic and organic crystals but also for low-dimensional systems including molecules.