A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
There is no function USERNAME, nor is there a USER.
Try this - for desktop versions of 365.
=LET(fullpath, INFO("DIRECTORY"),path, SUBSTITUTE(fullpath, "C:\Users", ""),LEFT(path, FIND("", path) - 1))
You can also use VBA, but that also requires desktop Excel.