Listing numbers appearing once in a range, then another column listing those occuring twice, then three etc...

welsh_philt

New Member
Joined
Jul 25, 2010
Messages
1
Hi,

I've an idea that would help me massively in work but I've no excel knowledge at all.

I've created a long column of numbers which can appear anywhere from once to seven times. I would like to create a table that has seven columns (cunningly entitled 'one appearance' to 'seven apperances') with the numbers that occur that many times listed below.

Is that possible?
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,094
Office Version
365, 2010
Platform
Windows
Hi,

I've an idea that would help me massively in work but I've no excel knowledge at all.

I've created a long column of numbers which can appear anywhere from once to seven times. I would like to create a table that has seven columns (cunningly entitled 'one appearance' to 'seven apperances') with the numbers that occur that many times listed below.

Is that possible?
Here's one approach, though probably not the most compact. Column A is the list of numbers. Columns B:H segment the first occurrence of each number into one of the seven bins. Columns J:P gives a consolidated listing. Columns B:H can be hidden if you like. Adjust the ranges to accommodate the length of your list. In this example the list occupies A2:A150.
Excel Workbook
ABCDEFGHIJKLMNOP
1Numbers12345671234567
290   90   3114236  
Sheet2
 

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
welsh_philt,


Excel Workbook
ABCD
11Unique Sorted NbrsCount
2217
3327
4432
5542
6651
7761
8171
92
101
112
121
132
141
152
161
172
181
192
203
214
22
Sheet1





The formula in cell C2 (confirmed with CTRL + SHIFT + ENTER ), copied down until it displays nothing:

=IF(ROWS($C$2:C2)>SUMPRODUCT(($A$1:$A$1000<>"")/COUNTIF($A$1:$A$1000,$A$1:$A$1000&"")),"",INDEX($A$1:$A$1000,MATCH(SMALL(IF(COUNTIF(OFFSET($A$1,0,0,ROW($A$1:$A$1000)-ROW($A$1)+1,1),$A$1:$A$1000)=1,COUNTIF($A$1:$A$1000,"<"&$A$1:$A$1000)),ROWS(C$2:$C2)),IF(COUNTIF(OFFSET($A$1,0,0,ROW($A$1:$A$1000)-ROW($A$1)+1,1),$A$1:$A$1000)=1,COUNTIF($A$1:$A$1000,"<"&$A$1:$A$1000)),0)))



The formula in cell D2 copied down:

=COUNTIF(A:A,C2)



If your list of numbers in column A goes beyound row 1000, then in cell C2, adjust the 1000's to a larger number.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
45,918
Office Version
365
Platform
Windows
Hi,

I've an idea that would help me massively in work but I've no excel knowledge at all.

I've created a long column of numbers which can appear anywhere from once to seven times. I would like to create a table that has seven columns (cunningly entitled 'one appearance' to 'seven apperances') with the numbers that occur that many times listed below.

Is that possible?
Welcome to the MrExcel board!

Apart from the suggestions already made, I'm wondering if you really do need 7 columns for your results?

If you do, then perhaps the sort of layout in D1:K6 below might be some use. The formula in E2 is copied across and down.

If you don't, then maybe Excel's built-in Pivot Table feature (shown in D11:E18 below) might be useful.

Excel Workbook
ABCDEFGHIJK
1NumberAppearances->1234567
21Numbers ->1 1
3222
4533
5144
6355
75
84
92
103
111Count of Number
122NumberTotal
13414
14227
15233
16243
17252
181Grand Total19
193
204
21
Summary
 
Last edited:

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,636
Messages
5,512,538
Members
408,903
Latest member
VicRattlehead

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top