There is a much simpler solution.
Simply navigate to Dev tools>> Template and paste below
{% for state in states %}
- {{- state.entity_id -}}
^ {{- state.name -}}
{% endfor %}
The resukt will be shown at right side. You can copy paste into excel and use text to columns to split using ^ symbol for ID and Name and find replace to remove leading - on the entity. Boom - you will have a neat excel in less than a minute