Correct with the formula. No doubt this is for a ideal gas.
However your map sensor is the issue , I should of explained it better. A map sensor cannot measure air volume and air speed. You can have a system where you have air speed and volume and no pressure , this is where you fall into trouble using a map sensor. Also map is a fixed table, AFM is actual