+ Reply to Thread
Results 1 to 7 of 7

CountIFS - ignore blank cells and cells with text in

  1. #1
    Registered User
    Join Date
    03-19-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    CountIFS - ignore blank cells and cells with text in

    Hi Guru's
    I have an excel workbook and wish to count the number of unique values across various sheets.I have the following which works until the value in column B of each sheet is either blank or has a text prefix to the number.

    =SUMPRODUCT((1/COUNTIFS('ORANGE SHIFT'!B11:B21,'ORANGE SHIFT'!B11:B21,'LIME SHIFT'!B11:B21,'LIME SHIFT'!B11:B21)))

    My question is :
    How do i make it ignore the blank cells and the cells with a text prefix in column B?

    Many thanks in advance for your assistance.
    Last edited by whitebits; 03-19-2018 at 07:29 AM. Reason: Spelling error

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: CountIFS - ignore blank cells and cells with text in

    Hello whitebits and Welcome to Excel Forum.
    I can not replicate the counting of unique numbers in the range B11:B21 on different sheets using the formula in post #1. I feel that I would need to be able to do that before I can proceed to modifying the formula to ignore blanks and text entries.
    It might help us to help you if you would upload a sample workbook that shows how the formula works. To upload a sample workbook click on the GO ADVANCED button below the Quick Reply window and then scroll down to Manage Attachments to open the upload window.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    03-19-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    Re: CountIFS - ignore blank cells and cells with text in

    Hi JeteMc,
    Please see attached.
    Sheet: Orange Shift B11:B21 - This is the data being queried. If the vaue is 'Zero' or 'Blank' then the formula in the results sheet doesn't work as it trys to divide by Zero (0/0 is nonsense)
    Sheet: Lime Shift B11:B21 - This is also the data being queried. If the vaue is 'Zero' or 'Blank' then the formula in the results sheet doesn't work as it trys to divide by Zero (0/0 is nonsense)
    Results Sheet: Number of unique values in B11:B21 on both Orange Shift and Lime Shift


    Many thanks
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: CountIFS - ignore blank cells and cells with text in

    I feel as if the formula is yielding a count of the unique values on the Lime Shift sheet only. If you run the Evaluate Formula tool you see that the 2's in the array align with values that are repeated in the range Lime Shift! B11:B21
    Also if the formula were counting the values from both sheets it would seem that 111 would have a count of 3, and the Evaluate Formula tool doesn't show any value as having a count of 3.
    Another check would be to put 999 in one of the cells in the range Orange Sheet! B11:B21, the count on the result sheet doesn't change although there should now be 10 unique values.
    Let us know if I have misunderstood the way the formula is working.

  5. #5
    Registered User
    Join Date
    03-19-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    Re: CountIFS - ignore blank cells and cells with text in

    Hi JeteMc,
    The formula is working fine for unique values however if the cell is blank or 0 the formula doesn't work.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,546

    Re: CountIFS - ignore blank cells and cells with text in

    In cell B20 on the Orange Shift sheet I replaced the value with 999. The unique values taken from the lists on both sheets are 111, 222, 333, 444, 555, 666, 777, 888, 999 and 1, however cell C4 on the results sheet displays 9.
    One way to find the unique values is to use the following array entered formula*, as modeled in E4:E14 on the Results Sheet:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Cell C10 on the results sheet then counts the values in list.
    If this is something that you would be interested in, then we can begin to look at ways to exclude blanks and zeros in the two original lists.
    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: CountIFS - ignore blank cells and cells with text in

    Hi all- This ARRAY FORMULA* counts unique non-zero numeric values across both sheets, ignoring blanks and text:
    Please Login or Register  to view this content.
    *Always press CTRL+SHIFT+ENTER to confirm entry after pasting or editing an ARRAY FORMULA in the Formula Bar.
    When copying the formula to other cells, make sure the copied cell is not part of the Paste Area.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

+ 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] Ignore blank cells with formulas or ignore NA() in a formula
    By guiismiti in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-24-2016, 02:13 PM
  2. Replies: 3
    Last Post: 09-04-2014, 01:41 PM
  3. How to ignore blank cells with multiple if scenarios based on text
    By KirtyLou in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-12-2014, 01:10 PM
  4. Ignore blank cells and truly blank cells in named range?
    By hschillig in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-13-2014, 02:56 PM
  5. Replies: 5
    Last Post: 05-18-2013, 07:49 PM
  6. How can I make a macro ignore blank cells? - Blank Cells have formulas
    By mz1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 08:54 AM
  7. Replies: 1
    Last Post: 06-29-2012, 01:16 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