Wholesale prices do bounce around significantly in a day, occasionally even going negative. And some miners do shutdown for brief periods during high demand due to a high electricity price. Some miners aren’t buying electricity from the grid, and have their own generation sources with different economic inputs. And there’s lots of day to day volatility in mining rates that has nothing to do with economics.
There’s no formula or methodology that could tell you how much energy is being wasted at any given moment. That impossible. There’s no way of knowing how many miners are operating globally at any given point in time. We can’t even reliably tell which country a block was mined in. We can only make reasonable estimates of global averages over the last few weeks.
You can get closer with more detailed modelling, but the equation I gave using global averages for bitcoin and electricity prices in the last few weeks will get you to an accurate estimate.