Formation S-wave attenuation, when combined with compressional attenuation, serves as a potential hydrocarbon indicator for seismic reservoir characterization. Sonic flexural wave measurements provide a direct means for obtaining the in situ S-wave attenuation at log scale. The key characteristic of the flexural wave is that it propagates at the formation shear slowness and experiences shear attenuation at low frequency. However, in a fast formation, the dipole log consists of refracted P- and S-waves in addition to the flexural wave. The refracted P-wave arrives early and can be removed from the dipole waveforms through time windowing. However, the refracted S-wave, which is often embedded in the flexural wave packet, is difficult to separate from the dipole waveforms. The additional energy loss associated with the refracted S-wave results in the estimated dipole attenuation being higher than the shear attenuation at low frequency. To address this issue, we have developed a new method for accurately determining the formation shear attenuation from the dipole sonic log data. The method uses a multifrequency inversion of the frequency-dependent flexural wave attenuation based on energy partitioning. We first developed our method using synthetic data. Application to field data results in a shear attenuation log that is consistent with lithologic interpretation of other available logs.