+ Reply to Thread
Results 1 to 6 of 6

[SOLVED]Addiitonal question on Countif - number occurrences in one cell

  1. #1
    Registered User
    Join Date
    09-22-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    3

    [SOLVED]Addiitonal question on Countif - number occurrences in one cell

    I'm very new to excel infact this is my first time using formulas.


    Sample Data :

    A Column

    A1 = 01-03-22
    A2 = 99-100-22
    A3 = 22-100-200

    I need to have an output counting the occurrences of the all numbers like the results below.

    22 = 3
    100 = 2
    ..
    ...
    ...

    anyone have an idea on what formula to count it ?


    My problem was partially solved by this formula but I realize I needd to convert the existing data to something like A1 = 01 B1 = 03 C1 = 22 which is one number per cell if I'm going to stick with the formula below.

    =COUNTIF(range:range, criteriarange:criteriarange)

    thank you
    Last edited by darksen; 09-24-2012 at 06:01 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Addiitonal question on Countif - number occurrences in one cell

    if your entries are always consistent, as shown - numbers - numbers - numbers, you can use these formulas to break them up into 3 cells (B1, C1, D1) for the count...

    in B1 =left(A1,2) (if this could contain more than a 2 digit number, use =LEFT(A2,FIND("-",A2,1)-1)
    in C1 =MID(A1,FIND("-",A1,1)+1,FIND("-",A1,FIND("-",A1,1)+1)-1-FIND("-",A1,1))
    in D1 =RIGHT(A1,LEN(A1)-FIND("-",A1,FIND("-",A1,1)+1))
    if you need the answer to be an actual number instead of text, use =value(above-formula)

    let me know how you make out?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-22-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Addiitonal question on Countif - number occurrences in one cell

    thank you FDibbins for the formula it does work for the three numbers unfortunately once in a while data could be something like 01-11-100-200-10-09. Maybe a flexible formula could break the data into B1=01 C1=11 D1=100 E1=200 F1=10 G1=09

    Right now i'm thinking of just breaking the original data to two like 01-11-100 & 200-10-09 which your formula will work. If there is no other solutions for my needs I will definitely use yours instead of doing it it manually.

    thank you again.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Addiitonal question on Countif - number occurrences in one cell

    ok, have you tried text-to-columns? use the "-" as the criteris, and then (if needed), delete the columns with "-"

  5. #5
    Registered User
    Join Date
    09-22-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: [SOLVED]Addiitonal question on Countif - number occurrences in one cell

    Its now working! I adjusted the second and the third code formula. like this code you gave =MID(A1,FIND("-",A1,1)+1,FIND("-",A1,FIND("-",A1,1)+1)-1-FIND("-",A1,1)) I just increase the numbers. Same Goes to D1 =RIGHT(A1,LEN(A1)-FIND("-",A1,FIND("-",A1,1)+1))

    thank you very much.


    in B1
    Please Login or Register  to view this content.

    in C1
    Please Login or Register  to view this content.
    in D1
    Please Login or Register  to view this content.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: [SOLVED]Addiitonal question on Countif - number occurrences in one cell

    great that you worked it out for yourself, and glad i could help. thx for the star too

+ 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