Forum Discussion
Mtumushi
Mar 11, 2021Copper Contributor
Transferring specific numbers from a column to a column
How do I move the specific numbers to a column that correspond to the numbers.. Kindly assist For example 1,2,3,5,9 and they are about 500 and I want to copy for example 9 to column 9..
- Mar 11, 2021
Hi Mtumushi
If I understand the requirement correctly, you need below formula:
=IFERROR(INDEX($A:$A,MATCH(COLUMN(),$A:$A,0),1),"")
Please let me know if it works for you. A sample file is also attached for your reference.
Thanks
Tauqeer
Mtumushi
Mar 11, 2021Copper Contributor
The numbers are in Excel in one cell. I have downloaded them from ODK data base and now want to align them to a specific answer in for example transfer 7 to column 7.
1, 2, 7
7
1, 2, 7
1, 7
1, 5, 6
1, 2, 4, 6, 7
1, 2, 5, 7
1, 2, 7
7
1, 2, 7
1, 7
1, 5, 6
1, 2, 4, 6, 7
1, 2, 5, 7
HansVogelaar
Mar 11, 2021MVP
Here is a macro you can run. It assumes that the values are in column A, starting in A1.
Sub MoveNumbers()
Dim r As Long
Dim m As Long
Dim a() As String
Dim i As Long
Dim c As Long
Application.ScreenUpdating = False
m = Cells(Rows.Count, 1).End(xlUp).Row
For r = 1 To m
a = Split(Cells(r, 1).Value, ", ")
Cells(r, 1).ClearContents
For i = 0 To UBound(a)
c = a(i)
Cells(r, c).Value = c
Next i
Next r
Application.ScreenUpdating = True
End Sub- MtumushiMar 11, 2021Copper ContributorDo you have some little time we do a video....
- HansVogelaarMar 11, 2021MVP
I can't do a video conference, if that's what you mean.
- MtumushiMar 11, 2021Copper ContributorMay be you can share your email.. Thanks