It is not difficult.
In fact, the operator “return value” does the same thing — it assigns a “value” to the “function name”. This is just a different syntax, the meaning of the last line in the function is the same.
Let’s look at a function that returns two values.
Function FilePathAndName() As Variant
' Returns file path excluding trailing separator and file name
' The result is an array of two elements.
Dim sTemp As String ' temporary string variable - the URL of the current document
Dim aTemp As Variant ' temporary variable of the variant - later it will be an array
Dim sFileName As String, sFilePath As String ' the purpose of these variables is clear from their names
sTemp = ConvertFromURL( ThisComponent.getUrl() ) ' get URL of current document
If sTemp = "" Then ' if document is new (not saved) then URL is empty string
sFileName = "file name undefined"
sFilePath = "file path undefined"
Else
aTemp = Split( sTemp, GetPathSeparator() )
sFileName = aTemp( Ubound(aTemp) ) ' last element of array is a part of string after last PathSeparator
sFilePath = Left( sTemp, Len( sTemp ) - Len( sFileName ) - 1 ) ' rest of URL-string is path
EndIf
FilePathAndName = Array( sFilePath, sFileName ) ' pack both value to array and return it as function name
End Function
You can enter in cell {=FILEPATHANDNAME()}
as an array formula and get in two adjacent cells two values returned by the function.

You can use this function in your other functions and procedures. For example,
Function FilePath() As String
' Returns file path excluding trailing separator
Dim aTemp As Variant
aTemp = FilePathAndName()
FilePath = aTemp(0) ' First element of array
End Function
Function FileName() As String
' Returns file name
Dim aTemp As Variant
aTemp = FilePathAndName()
FileName = aTemp(1) ' Second element of array
End Function
You can write each of these functions in a formula in a cell and get the desired result.
There is another way to return multiple values from a single function — you need to list all returned values as parameters by reference. In this case the function (usually, but not necessarily!) returns a boolean value - whether the execution was successful.
Function isFileNameGood(Optional ByRef sFileName As String, Optional ByRef sFilePath As String) As Boolean
sFileName = FileName()
sFilePath = FilePath()
isFileNameGood = (sFileName <> "file name undefined")
End Function
Of course, calling such a function from a table cell will not bring much benefit - you just get True if the current document is saved or False otherwise. You can use the calculated values of the path and name of file only by calling such a function inside your code.
Good luck!