The registry in Windows is a console that shows the structure of your Windows Operating system and it’s internal programs. The Hex codes inside the registry may change due to some unwanted conflicting programs which use the same resources.
To fix the installation error code 1731 in office 365/2010/2021 you need to delete the altered Office Registry keys or remove and re-create the keys with previous values. (HEXA CODE or H-KEYS).