+ Reply to Thread
Results 1 to 10 of 10

How to arange and count various numbers in previous column

  1. #1
    Registered User
    Join Date
    05-29-2007
    Posts
    7

    How to arange and count various numbers in previous column

    Hi

    I need help.

    Let's say there is a one column with 9 cells. I need in another column to be aranged various numbers in previous column and in another column to be counted every number how many times appears.
    Below is one small example of what I need.

    4 2 2
    8 4 3
    10 8 2
    4 10 1
    8 15 1
    15
    2
    2
    4


    Thanks in advance.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =COUNTIF($A$1:$A$9,B1)...B1 = 2 etc

    or

    =COUNTIF($A$1:$A$9,2) ...change to next number

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    05-29-2007
    Posts
    7
    Well, firts the numbers in column B should be arranged (different numbers that appears in column A sorted by smallest to bigger), and than in column C should all numbers be counted how many times they are in column A.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sorry,

    Don't follow you

  5. #5
    Registered User
    Join Date
    05-29-2007
    Posts
    7
    Example, I have one column of 9 cells; from A1 - A9

    4
    8
    10
    4
    8
    15
    2
    2
    4

    Now I need formula for column B to arrange different numbers that apperas in column A (sorted from the smallest)

    Example

    In column A smallest number that is in cells from A1 - A9 is 2. Cell B1 takes value 2, than follows number 4 ....

    Than column B takes this values (B1 - B5)

    2
    4
    8
    10
    15

    Now I need a formula for column C so all numbers should be counted how many times they appears in column A

    Number 2 appearS 2 times in cells A1-A9 and the value of cell C1 is 2. Number 4 appears 3 times and so on....

    So column C is taking this values (C1 - C5)

    2
    3
    2
    1
    1

    I need this operation to be done by Excel, with different number of cells.
    Last edited by bangalore; 06-04-2007 at 03:30 PM.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    1). Sort numbers in Col A
    2). In B1 enter =A1
    3). Enter this array (ctrl + Shift + Enter) in B2. Change range to your range or look at dynamic ranges

    =IF(ISERROR(MATCH(0,COUNTIF(B$1:B1,$A$1:$A$20&""),0)),"",INDEX(IF(ISBLANK($A$1:$A$20),"",$A$1:$A$20),MATCH(0,COUNTIF(B$1:B1,$A$1:$A$20&""),0)))

    4). Enter this in C1 and drag down

    =COUNTIF($A$1:$A$9,B1)

    http://www.contextures.com/xlNames01.html#Dynamic

    http://www.bettersolutions.com/excel...L315812332.htm

    HTH

    VBA Noob

  7. #7
    Registered User
    Join Date
    05-29-2007
    Posts
    7
    I'm working in Excel 2007. Changed , in ; like Excel suggested, pressed ctrl+shift+enter but nothing is appearing in B2. Tried in B3 nothing again.

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Does this help

    VBA Noob
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-29-2007
    Posts
    7
    Yes it does. Just like I needed.

    Thanks a million.

    Have a nice day.

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad it helped

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1