A relative humidity calculator in Excel lets you compute the ratio of actual water vapor pressure to saturation vapor pressure at a given temperature, usually expressed as a percentage. You enter the air temperature and either the dew point or the wet-bulb temperature, and the spreadsheet returns the relative humidity using the standard Magnus formula. This article explains the math, how to set up the formulas, and the common pitfalls to avoid.
Formula
The most widely used approximation for saturation vapor pressure is the Magnus formula (often credited to Alduchov and Eskridge, 1996):
es(T) = 6.1094 × exp( (17.625 × T) / (243.04 + T) )
where es is in hectopascals (hPa, equivalent to millibars) and T is in degrees Celsius. The relative humidity is then:
RH = 100 × ( es(Td) / es(T) )
where T is the air temperature and Td is the dew point temperature. The same formula works with wet-bulb temperature if you use the psychrometric equation, but that requires atmospheric pressure as well.
Worked Example
Using the default values from the calculator: air temperature T = 25 °C, dew point Td = 15 °C.
- Compute es(25): 17.625 × 25 = 440.625; 243.04 + 25 = 268.04; 440.625 / 268.04 = 1.6438; exp(1.6438) = 5.176; multiply by 6.1094 → 31.62 hPa.
- Compute es(15): 17.625 × 15 = 264.375; 243.04 + 15 = 258.04; 264.375 / 258.04 = 1.0245; exp(1.0245) = 2.785; multiply by 6.1094 → 17.02 hPa.
- RH = 100 × (17.02 / 31.62) = 53.8%.
The calculator gives 53.8% (rounded to one decimal), matching the step-by-step result.
Assumptions
- The Magnus formula is an approximation valid for temperatures roughly between −40 °C and +60 °C, with typical error less than 0.1% over that range.
- It assumes the air is at standard atmospheric pressure (1013.25 hPa). At very high altitudes, the saturation vapor pressure is slightly lower, but the error is small for most practical purposes.
- The formula uses dew point, not wet-bulb. If you only have wet-bulb, you need a psychrometric chart or a more complex equation that includes pressure.
- It assumes pure water vapor over a flat surface of liquid water. Ice saturation (for frost point) uses a different set of coefficients.
How to Build the Excel Calculator
Setting up a relative humidity calculator in Excel is straightforward. You need two input cells and one output cell. For example:
- Put the air temperature in cell A1 (e.g., 25).
- Put the dew point in cell B1 (e.g., 15).
- In cell C1, enter the formula:
=100*EXP((17.625*B1)/(243.04+B1) - (17.625*A1)/(243.04+A1)) - Format C1 as a number with one decimal place.
If you want to use wet-bulb temperature instead, you can add a second calculator based on the psychrometric formula, but that requires air pressure as an additional input. A simpler approach is to convert wet-bulb to dew point using an online tool or a lookup table, then use the formula above.
Common Mistakes and How to Avoid Them
- Using °F or °C inconsistently. The Magnus formula requires Celsius. If your data is in Fahrenheit, convert first: TC = (TF − 32) × 5/9.
- Forgetting that RH is not linear. A 10 °C dew point drop does not reduce RH by a fixed percentage; the relationship is exponential.
- Confusing dew point with wet-bulb. They are different. Dew point is the temperature at which condensation occurs; wet-bulb is the temperature read by a thermometer with a wet wick and is always higher than the dew point (except at 100% RH).
- Rounding too early. If you round intermediate vapor pressures to 2 decimals, the final RH can be off by several tenths. Keep full precision in the spreadsheet.
When to Use This Calculator
This calculator is useful for meteorology, HVAC design, greenhouse climate control, and any lab work where humidity affects results (e.g., weighing hygroscopic materials). It is also handy for understanding weather reports: if you know the temperature and dew point, you can estimate how humid it feels. The formula is accurate enough for most non-research applications, but for scientific publications, use the more precise Goff-Gratch equation or a reference table from a national metrology institute.
Limitations and Alternatives
The Magnus formula is not perfect. It assumes a flat water surface and does not account for dissolved salts (e.g., sea spray) or the curvature of small droplets. For extremely high accuracy, you might use the WMO (World Meteorological Organization) recommended formulas, which are more complex. Alternatively, you can use a psychrometric chart, which graphically relates dry-bulb, wet-bulb, and dew point. In Excel, you could also build a lookup table based on the ASHRAE handbook data, but the Magnus formula is usually sufficient.
Frequently Asked Questions
Can I calculate relative humidity from temperature and wet-bulb in Excel? Yes, but you need the psychrometric formula, which includes atmospheric pressure. A common approximation is: RH = 100 × (ew − A × P × (T − Tw)) / es(T), where ew is the saturation vapor pressure at the wet-bulb temperature, A is a psychrometric constant (about 6.66 × 10−4 per °C at sea level), P is pressure in hPa, and Tw is wet-bulb. This is less accurate than the dew point method.
What is the difference between relative humidity and dew point? Relative humidity is a percentage that tells you how close the air is to saturation. Dew point is an absolute measure of moisture content; a high dew point means more water vapor regardless of temperature. For example, 50% RH at 30 °C has a higher dew point than 50% RH at 10 °C.
Why does my Excel formula give #NUM! error? This happens when the temperature or dew point is outside the valid range (e.g., below −40 °C or above 60 °C), or when you accidentally use a negative number for a temperature that should be positive. Check that your inputs are in Celsius and within the range.
Is the Magnus formula the same as the one used by weather stations? Many weather stations use it, but some use the more accurate Goff-Gratch equation. The difference is usually less than 0.5% RH in the range of −20 °C to 50 °C, so for everyday use it is fine.
Can I use this calculator for freezing conditions? Yes, but below 0 °C the saturation vapor pressure over ice is slightly different. The Magnus formula can be used down to −40 °C with acceptable error, but for frost point, you should use the ice coefficients (e.g., A = 22.46, B = 272.62) instead.
Related
Formula used
in t | Air temperature | °C | 25 | -40 | 60 in td | Dew point temperature | °C | 15 | -40 | 60 out rh | Relative humidity | % | 100 * exp((17.625 * td) / (243.04 + td) - (17.625 * t) / (243.04 + t)) | 1
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- DNA to RNA in the Nucleus: How Transcription Works0.2000 mol/L
- DNA Sequence Example Code: A Practical Guide0.2000 mol/L
- RNA Sequence Reverse Complement Tool
- DNA Sequence Quality Q15: What It Means
- T4 RNA Ligase 2 Sequence & Function15,485.0 g/mol
- T7 RNA Polymerase Sequence: Full Gene & Key Features97.5 kDa