+ Reply to Thread
Results 1 to 6 of 6

Counting problems: count rang values while condition is true

Hybrid View

nemsho Counting problems: count rang... 04-11-2017, 10:00 AM
AliGW Re: Counting problems 04-11-2017, 10:12 AM
ChemistB Re: Counting problems: count... 04-11-2017, 10:21 AM
nemsho Re: Counting problems: count... 04-11-2017, 10:40 AM
ChemistB Re: Counting problems: count... 04-11-2017, 11:28 AM
nemsho Re: Counting problems: count... 04-11-2017, 05:10 PM
  1. #1
    Registered User
    Join Date
    04-11-2017
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    3

    Counting problems: count rang values while condition is true

    Dear Members of the excel Forum,

    I'm working on my school project in excel and I have some issues which I can't resolve. I want to count some cells in my excel sheet but with some conditions. I have to count only valid values. The values in columns cells are contains some strings which are valid or not (etc. ss, w, cb, f, .. are all valid values, but B and Z are not).

    Actions: While the rang cells are under the counting, the counting result must meet some condition (etc. result of valid scan need to be equal 50). The key point is If the condition is true, than the counting need to be break and function result must be returned.

    I have a several columns (with the values mentioned above) which doesn't have a same rang.

    I tyed to use some conbination of the function "=COUNTIF(A2:A134,IF((COUNTA(A2:A134)-COUNTIF(A2:A134,"Z")-COUNTIF(A2:A134,"B")),"=50", and than to paste this formula for another column, but in vain.

    Link to excelSheet:
    https://drive.google.com/file/d/0B_M...RqbjFzY2M/view


    Thanks allot!
    Attached Files Attached Files
    Last edited by nemsho; 04-11-2017 at 10:32 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,301

    Re: Counting problems

    Will you please attach a sample Excel workbook?

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Counting problems: count rang values while condition is true

    This is a fairly complex problem. Is this a University class? First issue is that COUNTIF(S) are not case sensitive so if you need to distinguish between "b" and "B", they won't do it.
    Are you allowed to use helper columns? In your worksheet, you are only looking for "Z" and "b" correct? And you want to stop counting if the total hits 50? Do you need to know what row it hit's 50 at? or is it simply that the maximum value can be 50?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    04-11-2017
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    3

    Re: Counting problems: count rang values while condition is true

    Dear ChemistB,

    First of all, I would like to thank you for your interesting in my presented issues. The value of "Z" and "B" are not correct or valid in the columns. In my excel sheet I only looking for a valid values, and not for all the values in column COUNT1. In the attached table, valid values are "ss, w, cb, f", and so on, and not valid values are only "B" and "Z". In my represented function, values "B" and "Z" are recognize in the functions as a not valid values and then all of it are subtracted from the rest of the counted total scan. The counting must be stopped when condition is true (when a valid scans equal 50). I hope I explained well now.
    Last edited by nemsho; 04-11-2017 at 10:57 AM.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Counting problems: count rang values while condition is true

    Does this work for you? I used conditional formatting to color cells green as you go down the column. As soon as the cell stops turning green, you've reached your 50 stop point.

    I used this formula in the conditional formatting
    =COUNTA($A$2:$A2)-COUNTIF($A$2:$A2, "Z")-COUNTIF($A$2:$A2, "b")<=50
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-11-2017
    Location
    Budapest
    MS-Off Ver
    2010
    Posts
    3

    Re: Counting problems: count rang values while condition is true

    Dear CheminstB,
    =COUNTA($A$2:$A2)-COUNTIF($A$2:$A2, "Z")-COUNTIF($A$2:$A2, "b")<=50
    That's it! Thank you very much.

+ 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. [SOLVED] problems for counting
    By Don Guillett in forum Excel Formulas & Functions
    Replies: 48
    Last Post: 09-06-2005, 07:05 PM
  2. problems for counting
    By philip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. [SOLVED] problems for counting
    By philip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  4. [SOLVED] problems for counting
    By Don Guillett in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 09-06-2005, 02:05 PM
  5. [SOLVED] problems for counting
    By philip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  6. [SOLVED] problems for counting
    By philip in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. problems for counting
    By Don Guillett in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-06-2005, 07:05 AM
  8. [SOLVED] problems for counting
    By philip in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-04-2005, 12:05 PM

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