To create a new Named Functions in Sheets, go to Data > Named functions > Add new function > enter details > Next > Create. Once the custom function has been created, you can then enter it into a Sheet’s cell to use it. Note that Named Functions that are created in a file are available only within that file and will need to be imported into the new file in order to use it. You can do this by selecting Data > Named functions > import function > and picking the function you want.

Source: Google Sheets introduces Named Functions for easier reusing