+ Reply to Thread
Results 1 to 7 of 7

Count cell

  1. #1
    Registered User
    Join Date
    09-05-2017
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2013
    Posts
    2

    Question Count cell

    Hello, I want to count the cells containing "TRUE" or "FALSE". Using COUNTIF function I can't do that. Based on the CRITERIA when there is TRUE or FALSE in a cell it simply doesn't count that cell.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Count cell

    afr_070 welcome to the forum.

    That should work.

    Copy and paste the actual formula(s) you are using into your next post. There may be a detail overlooked.
    Dave

  3. #3
    Registered User
    Join Date
    09-05-2017
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2013
    Posts
    2

    Re: Count cell

    Dear Dave thanks. Please find below the table and function I tried.

    Times access today
    5
    4
    3
    TRUE
    2
    7
    FALSE
    9
    6

    COUNTIF Function: COUNTIF(D4:D12,J6)

    When I set criteria ">=1" then it shows 7. It ignores "TRUE" cell count. I also tried ISVALUE() and ISTEXT() function to check "TRUE" and "FALSE". In both cases, those functions return FALSE. But I want to count "TRUE" or "FALSE" cell as number as I know TRUE = 1 and FALSE = 0. Also when I tried to convert text to number using VALUE() function, it returns "#VALUE!" for both "TRUE" and "FALSE" cell.

    Sorry for formatting to paste the code.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,359

    Re: Count cell

    Try this:

    =COUNT(SUMPRODUCT(--D4:D12>=1),D4:D12)
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Count cell

    But I want to count "TRUE" or "FALSE" cell as number as I know TRUE = 1 and FALSE = 0.
    That is only true if TRUE / FALSE are coerced by mathematical operation or by preceding with "--" (double unary). Until then they remain text. Numeric functions ignore these by design.

    Without seeing an uploaded Excel file (not pictures or screenshots) it is difficult to suggest alternatives without real data context.

    If you do not know how to do this:

    To attach a file to your post,
    • be sure to desensitize the data
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”

    The file name will appear at the bottom of your reply.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,359

    Re: Count cell

    That is only true if TRUE / FALSE are coerced by mathematical operation or by preceding with "--" (double unary).
    See post #4.
    Last edited by AliGW; 09-06-2017 at 01:27 AM.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Count cell

    Quote Originally Posted by AliGW View Post
    See post #4.
    Yes. I was responding to the apparent expectation that COUNTIF would read TRUE / FALSE as 1s and 0s.

+ 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] Pivot for Count and count result as percentage of another cell
    By JEA_123 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-22-2015, 07:54 AM
  2. Replies: 2
    Last Post: 05-28-2014, 07:58 PM
  3. Removing duplicates in a count, count based on value in a different cell
    By omf_24 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-10-2013, 07:08 AM
  4. [SOLVED] for every line I browse make a count and post this count in a cell (fiouuu)
    By historic777 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2013, 06:41 AM
  5. Replies: 6
    Last Post: 12-22-2012, 05:04 PM
  6. get a count of filtered data , count should be as values in cell.
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2012, 06:31 PM
  7. Count one cell and then count 52 cells later...
    By ArnyVee in forum Excel General
    Replies: 6
    Last Post: 03-05-2009, 03:47 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