def to_float_if_possible(s):
    """
    Convert to float if possible.

    Parameters
    ----------
    s: str

    Returns
    -------
    float or None
    """
    try:
        return float(s)
    except ValueError:
        if s.strip() == '':
            return None
        else:
            return s
