The excitation temperature T ex for molecular emission and absorption lines is an essential parameter for interpreting the molecular environment. This temperature can be obtained by observing multiple molecular transitions or hyperfine structures of a single transition, but it remains unknown for a single transition without hyperfine structure lines. Earlier H2CO absorption experiments for a single transition without hyperfine structures adopted a constant value of T ex, which is not correct for molecular regions with active star formation and H ii regions. For H2CO, two equations with two unknowns may be used to determine the excitation temperature T ex and the optical depth τ, if other parameters can be determined from measurements. Published observational data of the 4.83 GHz (λ = 6 cm) H2CO (110−111) absorption line for three star formation regions, W40, M17 and DR17, have been used to verify this method. The distributions of T ex in these sources are in good agreement with the contours of the H110α emission of the H ii regions in M17 and DR17 and with the H2CO (110−111) absorption in W40. The distributions of T ex in the three sources indicate that there can be significant variation in the excitation temperature across star formation and H ii regions and that the use of a fixed (low) value results in misinterpretation.