+ Reply to Thread
Results 1 to 4 of 4

count 1 ,2

  1. #1
    Registered User
    Join Date
    05-24-2020
    Location
    greece
    MS-Off Ver
    2010
    Posts
    76

    count 1 ,2

    hi i have in a row the foloowing2212122112112
    , i needa formula to count how many 2 there are and how many 1.thanks

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: count 1 ,2

    Assuming that your string is composed only of "1" and "2",
    Then you can chop out the character you're testing against and see what the difference in string lengths is:
    Please Login or Register  to view this content.
    So that's counting a total of six "1" and seven "2"
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: count 1 ,2

    =Countif(A1:M1,2) result 7

    =Countif(A1:M1,1) result 6
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  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: count 1 ,2

    Is that in a single cell, or in different cells across a row?
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-03-2018, 05:00 AM
  2. =count separate date & time and count dates inside or outside 30 days
    By Beret in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-16-2017, 10:26 AM
  3. Replies: 1
    Last Post: 05-19-2017, 07:37 AM
  4. Replies: 17
    Last Post: 04-11-2016, 11:14 PM
  5. Macro count items in sheet2 and provide count in embedded label in sheet1
    By jaredmccullough in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-05-2015, 11:27 AM
  6. Range.columns.count property returns wrong count after union operation
    By gopinan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2008, 04:48 AM
  7. [SOLVED] Count Intervals of Filtered TEXT values in Column and Return Count across a Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM

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