def find_in_listdict(listdict, search_key, val, return_key):
    """
    For a given listdict (list of dictionary), if dict[search_key] is equal
    to val, return dict[return_key].  Return None if no match is found.
    """
    search_key_exists = False

    for _ in listdict:
        if search_key in _:
            search_key_exists = True
            if _[search_key] == val:
                if return_key in _:
                    return _[return_key]
                else:
                    raise ValueError("return_key doesn't exist")
    else:
        if search_key_exists:
            return None
        else:
            raise ValueError("search_key doesn't exist")