Hi Perdben, welcome to the forum. Please take a moment to read our forum rules. In the future, please wrap your code using the # button in the post editing window. I've done it for you this time, but future posts may be locked.
As for your issue, when referring to a named range, use Range("Your_Named_Range"), qualify the variable types you're passing to the function, and use Application.WorksheetFunction.[some_function_here].
For example:
Public Function ytdvol(x1 As Range, x2 As Range)
x3 = Application.WorksheetFunction.VLookup(x1, Range("PriceHist"), 3, False)
x4 = Application.WorksheetFunction.VLookup(x2, Range("PriceHist"), 3, False)
ytdvol = x3 + x4
End Function
Be sure to put this into a standard Module, not in your Worksheet or ThisWorkbook code window.
Bookmarks