If one cell is blank, Show what is in the adjacent cell.

Iraelaemei

New Member
Joined
Nov 13, 2014
Messages
34
Sorry if the title is misleading.

What I am wanting to do is for the below image, if there is a blank in the 'Do we have it' column, I want to return what is in the Document column. When I tried a nested IF statement, it would only return what the first blank showed, and I need to show all of the blanks.


Thanks



f2db5332c15127ef35d3862dac37f943.png
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Thanks for the reply, I realized that my post wasn't clear. I want the results of what is blank to be displayed in one cell.
 
Upvote 0
One way is to use VBA and create your own function that does it.

Here is a function that I came up with:
Code:
Function ReturnBlanks(myRange As Range) As String

    Dim cell As Range
    Dim myString As String
    
    For Each cell In myRange
        If cell = "" Then myString = myString & cell.Offset(0, 1).Value & ","
    Next cell
    
    If Len(myString) > 0 Then ReturnBlanks = Left(myString, Len(myString) - 1)
        
End Function
So let's say that the data sample you posted is in range A1:B8. I wrote it so you just reference column A in the formula, and it will return the corresponding column B entries for the blank column A values.

So, you would enter a formula like this:
=ReturnBlanks(A2:A8)

which will return:
Deed,Truth-In-Lending
 
Upvote 0
One way is to use VBA and create your own function that does it.

Here is a function that I came up with:
Code:
Function ReturnBlanks(myRange As Range) As String

    Dim cell As Range
    Dim myString As String
    
    For Each cell In myRange
        If cell = "" Then myString = myString & cell.Offset(0, 1).Value & ","
    Next cell
    
    If Len(myString) > 0 Then ReturnBlanks = Left(myString, Len(myString) - 1)
        
End Function
So let's say that the data sample you posted is in range A1:B8. I wrote it so you just reference column A in the formula, and it will return the corresponding column B entries for the blank column A values.

So, you would enter a formula like this:
=ReturnBlanks(A2:A8)

which will return:
Deed,Truth-In-Lending


Thank you so much, that solves my issue!
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,331
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top