How to return the text that is in one column, in another column, ignoring zero values or blanks

Porcupine_

New Member
Joined
Jul 26, 2016
Messages
28
I have a column that has some cells filled with text, and some blank. I want to create a separate column that returns only the cells filled with text, ignoring blanks. I've shown what I mean in a table below. Is anyone able to help with this?

Column with dataReturn with formula
TextText
Text
Text

<tbody>
</tbody>

Thank you very much
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Assuming we are dealing with columns "A" and "B"
Here is a vba solution.

Code:
Sub My_Data()
'Modified 3-1-18 9:00 AM EST
Application.ScreenUpdating = False
Dim i As Long
Dim b As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
b = 1
    For i = 2 To Lastrow
        If Cells(i, 1).Value <> "" Then Cells(b, 2).Value = Cells(i, 1).Value: b = b + 1
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thank you - sorry I should have said - I want to avoid using a VBA solution, and just make it work with formulas - do you know if this is possible?
 
Upvote 0
Thank you - sorry I should have said - I want to avoid using a VBA solution, and just make it work with formulas - do you know if this is possible?

There may be a formula but if there is I do not know what it is.
I do more Vba then formulas.

Maybe someone else here at Mr. Excel will be able to help you.
 
Upvote 0
A
B
1
aa
2
b
3
c
4
bd
5
f
6
g
7
h
8
ci
9
j
10
k
11
l
12
m
13
d
14
15
16
17
18
19
20
f
21
22
23
24
25
26
g
27
28
29
30
31
32
33
34
35
36
h
37
38
39
40
41
42
43
44
i
45
46
47
48
49
50
51
52
53
54
j
55
56
57
58
59
60
61
k
62
63
64
65
66
l
67
68
69
70
71
72
m

<tbody>
</tbody>

B1=IFERROR(INDEX($A$1:$A$72,SMALL(IF($A$1:$A$72<>"",ROW($A$1:$A$72)-ROW($A$1)+1),ROWS($A$1:A1))),"")

control+shift+enter copy down
 
Upvote 0
That looks to be exactly what I need, but for some reason it isn't working. Would it be affected if the text in column A are coming via a formula?
 
Upvote 0
It seems to return the text in the first row, if there is text there, but doesn't return anything else.
 
Upvote 0
That looks to be exactly what I need, but for some reason it isn't working. Would it be affected if the text in column A are coming via a formula?

It works for me.
Put = in cell B1
Then paste in the formula
Then press Ctr+Shift+Enter

Then to continue down column just drag the cell down.
Do this by clicking on bottom right corner of cell with formula you should see a + appear and drag that down.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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