This function I've wrote takes the right cell as argument, and, if that cell is not empty, returns it's value , otherwise the value of the cell above the cell where the function resides:
Function MyFunction(rightcell As Range)
Application.Volatile True
MyFunction = IIf (rightcell (1, 1).Value <> "", rightcell (1, 1).Value, rightcell(1, 1).Offset(-1, -1).Value)
End Function
To make the function available proceed as following:
-Press Alt+F11- this will bring up the VBA editor
-navigate to Insert > Module to open a blank module screen
-paste the above code there
-close the VBA editor
As in your example,in B3 cell, you will call te function like this:
=MyFunction(C3)