How to display whole numbers from list in separate column

arthurklein43

New Member
Joined
Aug 3, 2018
Messages
15
Hello
I have a question how to pick and display only the whole numbers (integers) to separate column.
For example i have a few hundreds numbers in column A. some of them are integers and I need them to be displayed in order in separate column let say column C so i can see them separate.
ex. column A has numbers 1.11;1.52;2;2.63;3;3.4521. I need integer numbers 1;2 and 3 to be picked from that list and displayed in column C in order they are 1;2;3
Thank you everyone in advance for the help.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
i have a few hundreds numbers in column A. some of them are integers and I need them to be displayed in order in separate column let say column C so i can see them separate.
ex. column A has numbers 1.11;1.52;2;2.63;3;3.4521. I need integer numbers 1;2 and 3 to be picked from that list and displayed in column C in order they are 1;2;3
You say some of them are integers and you want those integers extracted into another column. I can't see the integer 1 in your sample data. How does it get to be in column C?

When you say you want them "in order", do you mean in numerical order, or the order that they appear in column A?

Can an integer appear more than once in column A? If so, does it get listed more than once in column C?
 
Upvote 0
Oops. my bad. I missed the 1.
I meant in order the way they appear in column A
I dont think there will be duplicates but even if there are they can appear in column C as much as they are integers. For me it is important to see all integers no matter if duplicates or not. Thank you so much for the quick response
 
Upvote 0
How about
Code:
Sub FindInt()
   Dim ary1 As Variant, ary2 As Variant
   Dim Itm As Variant
   Dim i As Long
   
   ary1 = Range("A2", Range("A" & Rows.Count).End(xlUp))
   ReDim ary2(1 To UBound(ary1))
   For Each Itm In ary1
      If Itm = Int(Itm) Then
         i = i + 1
         ary2(i) = Itm
      End If
   Next Itm
   Range("C2").Resize(i).Value = Application.Transpose(ary2)
End Sub
 
Upvote 0

Excel 2010
AB
211
31.1 
6b
Cell Formulas
RangeFormula
B2=(MOD(A2,1)=0)*A2
B3=(MOD(A3,1)=0)*A3


Set the workbook to hide 0 or revise the formula to show blank.
 
Last edited:
Upvote 0

Excel 2010
ABCD
22.63   
31111
6b
Cell Formulas
RangeFormula
B2=(MOD(A2,1)=0)*A2
B3=(MOD(A3,1)=0)*A3
C2=IF(MOD(A2,1)=0,A2,"")
C3=IF(MOD(A3,1)=0,A3,"")
D2=IF(MOD(A2,1),"",A2)
D3=IF(MOD(A3,1),"",A3)
 
Last edited:
Upvote 0
Here is another macro that you can consider...
Code:
[table="width: 500"]
[tr]
	[td]Sub FindInt()
  With Range("A1", Cells(Rows.Count, "A").End(xlUp))
    .Offset(, 2) = Evaluate(Replace("IF(INT(@)=@,@,"""")", "@", .Address(0, 0)))
    .Offset(, 2).RemoveDuplicates 1, xlNo
  End With
  Range("C2").Delete xlShiftUp
End Sub[/td]
[/tr]
[/table]
 
Upvote 0
Maybe...


A
B
C
1
Numbers​
Integers​
2
1,11​
2​
3
1,52​
3​
4
2​
5
2,63​
6
3​
7
3,4521​
8

<tbody>
</tbody>


Array formula in C2 copied down
=IFERROR(INDEX(A$2:A$7,SMALL(IF(INT(A$2:A$7)=A$2:A$7,ROW(A$2:A$7)-ROW(A$2)+1),ROWS(C$2:C2))),"")
Ctrl+Shift+Enter

M.
 
Last edited:
Upvote 0
Excel 2010
ABCD
22.63
31111

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
6b

Worksheet Formulas
CellFormula
B2=(MOD(A2,1)=0)*A2
C2=IF(MOD(A2,1)=0,A2,"")
D2=IF(MOD(A2,1),"",A2)
B3=(MOD(A3,1)=0)*A3
C3=IF(MOD(A3,1)=0,A3,"")
D3=IF(MOD(A3,1),"",A3)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Hi
Thank you for your response. are these 3 formulas alternatives and I can use either one or they need to be used all 3.
I havent tried them yet but looks like they display the integer number in the same row where the original is. but the problem here is if I have a long column of numbers I still have to scroll down to see each number.
My whole point was to display them in separate column in consecutive cells so i can see them easy all together. Sorry I should of be more clear. Any way we can do this. thanks
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

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