+ Reply to Thread
Results 1 to 5 of 5

Count the cells in a string of cells omitting zeros and specific cells

  1. #1
    Forum Contributor
    Join Date
    01-07-2015
    Location
    Mid Wales, UK
    MS-Off Ver
    Office 2003
    Posts
    115

    Count the cells in a string of cells omitting zeros and specific cells

    Hello All - I am having a problem with some formula, which I just can’t seem to get my head around, so I wonder if someone can help me please.

    I have several columns of data for which I need to count the cells which contain a figure in each column. The number of cells I need to count are from A8:A905, this is simple enough, but there are two other factors which have to be taken into consideration.

    a) All the empty cells in the column contain a zero; I don’t want to count these cells. b) Also, I don’t want to count some specific cells either whether they contain a figure or not, these cells are – A206, A686, A742, A749, & A768.

    I’m sure there is probably an easy answer to this, but it’s just defeating me at the moment, I would be very grateful for any assistance, thanks.

    Hawkmoth1

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Count the cells in a string of cells omitting zeros and specific cells

    maybe: =COUNTIF(A8:A905,"<>" & 0)-5
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Count the cells in a string of cells omitting zeros and specific cells

    Try this ...

    =COUNT(A8:A905/A8:A905)-COUNT(A206/A206,A686/A686,A742/A742,A749/A749,A768/A768)

    Enter with Ctrl+Shift+Enter.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Count the cells in a string of cells omitting zeros and specific cells

    Try
    =COUNTIF(A8:A905,"<>"&0)-SUM(INDEX((CHOOSE({1,2,3,4,5},A100,A686,A742,A749,A768)<>0)+0,0))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Contributor
    Join Date
    01-07-2015
    Location
    Mid Wales, UK
    MS-Off Ver
    Office 2003
    Posts
    115

    Re: Count the cells in a string of cells omitting zeros and specific cells

    Hello Phuocam - thanks, that's done it a treat.

    I've added reputation and the post as solved.

    hawkmoth1

+ 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: 4
    Last Post: 02-11-2015, 09:02 AM
  2. Replies: 16
    Last Post: 04-06-2014, 08:31 AM
  3. Function returning cells containing text and omitting blank cells.
    By reszax in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2013, 03:15 PM
  4. Median formula that does not count empty cells and zeros
    By Domyzon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2013, 01:29 PM
  5. Replies: 5
    Last Post: 02-04-2013, 05:32 PM
  6. [SOLVED] How do I get the average across multiple cells not in a range and not count the zeros/text
    By sponge_designs in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2013, 03:05 AM
  7. [SOLVED] Count cells with specific values in the cells next to them?
    By Christopher in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-08-2005, 01: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