Outputting result as 2 separate columns
According to rule to find median(average if even number of values &amp; middle number if odd number of values). It can be done like this.

CREATE PROCEDURE dbo.spAvg_Median 
    @input nvarchar(20) 
AS
BEGIN
    declare @split table(id int primary key identity (1,1), number int)
    declare @count int

    INSERT INTO @split SELECT value FROM string_split(@input, ',')
    select @count=count(*) from @split

        SELECT AVG(A.number) as [Average],B.Median
            FROM @split A
        CROSS APPLY
                    (
                    SELECT Median FROM (
                    SELECT
                              o.number AS [Median]
                            , rn=ROW_NUMBER() OVER (ORDER BY o.number ASC)
                    FROM    @split AS o        
                    ) AS x
                    WHERE rn =ROUND(@count/2.0,0)
                    ) B
        GROUP BY B.Median
END
RETURN 0 
GO


Thanks!