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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Here is another macro that you can consider...
Code:
[TABLE="width: 500"]
<tbody>[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]
</tbody>[/TABLE]

Hi . thank you
but unfortunately I am not familiar with macros at all.
 
Upvote 0
Maybe...


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Numbers​
[/TD]
[TD][/TD]
[TD]
Integers​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
1,11​
[/TD]
[TD][/TD]
[TD]
2​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
1,52​
[/TD]
[TD][/TD]
[TD]
3​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
2,63​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD]
3,4521​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
8
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


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.

Thank you so much. this is what i need. You guys rock
 
Upvote 0
Hi . thank you
but unfortunately I am not familiar with macros at all.
If you wanted to give them a try, here are the instructions on how to implement them...

HOW TO INSTALL MACROs
------------------------------------
If you are new to macros, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the whichever macro code you want to try (since both macros have the same name, make sure to remove one before copy/pasting thinto the code window that just opened up. That's it.... you are done. To use the macro, go back to the worksheet with your data on it and press ALT+F8, select the macro name (FindInt) from the list that appears and click the Run button. The macro will execute and perform the action(s) you asked for. If you will need to do this again in this same workbook, and if you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "Yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
 
Upvote 0
I apologize for the double posts. got so exited and didnt use reply with quote. New to this forum and still learning . I would like to thanks everyone who spent some time to work on this and specially Marcelo who provided the solution. Thanks guys:beerchug:
 
Upvote 0
If you wanted to give them a try, here are the instructions on how to implement them...

HOW TO INSTALL MACROs
------------------------------------
If you are new to macros, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the whichever macro code you want to try (since both macros have the same name, make sure to remove one before copy/pasting thinto the code window that just opened up. That's it.... you are done. To use the macro, go back to the worksheet with your data on it and press ALT+F8, select the macro name (FindInt) from the list that appears and click the Run button. The macro will execute and perform the action(s) you asked for. If you will need to do this again in this same workbook, and if you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "Yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.

I appreciate this explanation. I always wanted to learn more how to use macros but never had time and chance to do it. maybe this will give me the little push i need. Thanks
 
Upvote 0
Hmm, a fair bit has happened while I was asleep. :)
Just to add one more to the mix - similar to Marcelo's but this does not require the Ctrl+Shift+Enter confirmation.

Excel Workbook
ABC
1NumbersIntegers
21.112
31.523
42
52.63
63
73.4521
8
List Integers



I know you said you wanted them in the order they appear in column A, but if that wasn't the case, the formula becomes simpler.

Excel Workbook
ABC
1NumbersIntegers
21.111
31.522
422
52.633
63
73.4521
81
92.2
102
11
List Integers (2)
 
Last edited:
Upvote 0
Hmm, a fair bit has happened while I was asleep. :)
Just to add one more to the mix - similar to Marcelo's but this does not require the Ctrl+Shift+Enter confirmation.

List Integers


ABC















<colgroup><col style="font-weight:bold; width:30px; "><col style="width:91px;"><col style="width:27px;"><col style="width:56px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]
[TD="align: right"]Numbers[/TD]

[TD="align: right"]Integers[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]1.11[/TD]

[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="align: right"]1.52[/TD]

[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="align: right"]2.63[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]
[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]
[TD="align: right"]3.4521[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]8[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C2=IFERROR(INDEX(A$2:A$7,AGGREGATE(15,6,(ROW(A$2:A$7)-ROW(A$2)+1)/(MOD(A$2:A$7,1)=0),ROWS(C$2:C2))),"")

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4


I know you said you wanted them in the order they appear in column A, but if that wasn't the case, the formula becomes simpler.

List Integers (2)


ABC



















<colgroup><col style="font-weight:bold; width:30px; "><col style="width:91px;"><col style="width:27px;"><col style="width:56px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]
[TD="align: right"]Numbers[/TD]

[TD="align: right"]Integers[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]1.11[/TD]

[TD="align: right"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="align: right"]1.52[/TD]

[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="align: right"]2[/TD]

[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="align: right"]2.63[/TD]

[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]
[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]
[TD="align: right"]3.4521[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]8[/TD]
[TD="align: right"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]9[/TD]
[TD="align: right"]2.2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]10[/TD]
[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]11[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C2=IFERROR(AGGREGATE(15,6,A$2:A$10/(MOD(A$2:A$10,1)=0),ROWS(C$2:C2)),"")

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Hi Peter
Thank you for your respond. I think both of these will work since the numbers in the A column I have are in descending order. looks like the order in result column is in ascending order and this will be the only difference.
Anyway unfortunately I got busy trying to resolve another project and wasted my whole day off today trying to do it without asking for help. This clearly was a mistake since there is a great community over here willing to help.
I will post my new question in separate post since it is not related to this one. Thank you again.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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