In this Excel tutorial, you will learn how to get the first and last non-blank cell value in a range. In Ms SQL Coalesce is function is used to return the first non-null (non blank) value. Here I have implemented this function using inbuilt Excel functions and using VBA. I have also shown how you can build a single VBA custom function (VBA UDF) that can return first, last, and Nth non-blank cell value from a range based on the data type.