I'm not sure how legit this is, but nobody's ever contradicted me.
If an entire flight is IFR, I log the entire flight as IFR.
If (say) I fly the departure and arrival VFR and the route IFR, I make a rough note of the start and end times of the IFR period, and log that time in a column in my logbook as IFR.
Similarly "sole reference to instruments" which personally I choose to log separately, but is of course much more clearcut. All time by sole reference I take as IFR, but obviously some IFR time can be VMC.
G