+ Reply to Thread
Results 1 to 6 of 6

Relative reference in Countifs

Hybrid View

  1. #1
    Registered User
    Join Date
    05-31-2017
    Location
    Brunswick, ME
    MS-Off Ver
    2013 (work) and 365 (home)
    Posts
    70

    Relative reference in Countifs

    I'm trying to count the number of cells that have values in excess of a 10% tolerance of another cell in its row.
    I can't figure out how to make the Countifs function reference each row. I feel like this should be an array, but don't how how to set it up.
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Relative reference in Countifs

    Here is a test,
    In E2:E16 I have
    Formula: copy to clipboard
    =IF(ABS(B2-C2)<0.1,"ok","Nope")


    Then in G2 I have< count the Nope's or ok's
    Formula: copy to clipboard
    =COUNTIF(E2:E16,"Nope")

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

    Re: Relative reference in Countifs

    Try using SUMPRODUCT

    =SUMPRODUCT(--(D2:D16/B2:B16> 0.1))
    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
    05-31-2017
    Location
    Brunswick, ME
    MS-Off Ver
    2013 (work) and 365 (home)
    Posts
    70

    Re: Relative reference in Countifs

    ChemistB,

    Thanks. That mostly works, but in my actual data set I have some 0s in column B, which of course gives the #DIV/0! error. How can I get around that?

  5. #5
    Registered User
    Join Date
    05-31-2017
    Location
    Brunswick, ME
    MS-Off Ver
    2013 (work) and 365 (home)
    Posts
    70

    Re: Relative reference in Countifs

    I think I figured it out from ChemistB's initial solution:
    Formula: copy to clipboard
    {=SUMPRODUCT(--(D2:D16/IF(B2:B16=0,1,B2:B16)> 0.1))}

    That may be overly complex for what I'm trying to do, but I'm running with it for now.

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

    Re: Relative reference in Countifs

    That works. Good job.

+ 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] Sumproduct to replace countifs as countifs don't work on external source reference
    By KrishnaSagar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2017, 02:33 AM
  2. Replies: 12
    Last Post: 03-23-2017, 01:24 PM
  3. Replies: 5
    Last Post: 09-21-2012, 02:08 PM
  4. change from relative reference to absolute reference
    By ronlau123 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2011, 04:57 AM
  5. Relative Reference
    By JDMCMAMC815 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2010, 02:33 PM
  6. Replies: 0
    Last Post: 11-15-2007, 02:35 AM
  7. [SOLVED] relative reference
    By Swannybuck in forum Excel General
    Replies: 1
    Last Post: 07-26-2006, 04:30 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