I can certainly understand the desire to do factory resets -- given the prevalent view that such an action, though extreme, will fix a variety of mysterious problems and return a troublesome PC to working condition.
Problem is -- that very often is NOT the case and if there is any hardware issue at all, which is nearly always the cause with a SLOW PC (which is why most folks do the factory resets), you end up trashing your PC and rendering it useless. So, you trade a SLOW PC for a non-working PC. Not a good trade -- and certainly not what you intended.
IF MS Office 365 came with your PC and you need to reinstall it, then you have a problem because HP does not provide separate downloads for products that come preloaded. You would have to contact HP Support yourself to see if they can provide you any assistance on this. Contact link is below ...
If you have the MS Office 365 software but are having problems installing or activating it, since this is an MS product, we have no way to debug or fix issues with that. You would have to contact Microsoft Office support for that.
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".