+ Reply to Thread
Results 1 to 3 of 3

Help with formula OFFSET nested in COUNTIFS

  1. #1
    Registered User
    Join Date
    03-26-2015
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    Help with formula OFFSET nested in COUNTIFS

    Hi

    I need help with a formula.
    I want to return a 1 or 0 when True or False for the following condition:

    A B C D E F G H
    1 Name Abv Name Abv A Matches, Not B B Matches, Not A
    2 GRAY WOLF GWF FORCE RECON FRC 1 0
    3 GREEN LAMPOST GL GRAY WOLF GRR 0 0
    4 BRAVES COUNTRY BCY BRAVES COUNTRY BRY 1 0
    5 FORCE RECON FRC GREEN LANTERN GL 0 1


    Return 1: When A1 is found in column D (cell unknown) AND A2 does not match its counterpart in column E (cell unknown)
    Return 0: When A1 is found in column D (cell unknown) AND A2 does match its counterpart in column E (cell unknown)

    I am calculating the values for column E with (it has to be the adjacent cell to where found in column D):
    =OFFSET(INDIRECT(ADDRESS(MATCH(A2,$D$2:$D$5,0)+ROW($D$2)-1,COLUMN($D$2),4)),0,1)

    In the example above I am getting:
    GRR
    #N/A
    BRY
    FRC

    This seems correct.

    But when I nest this formula into COUNTIFS to get 1 or 0, I get all 0s:
    =COUNTIFS($D$2:$D$5,A2,$E$2:$E$5,"<>"&OFFSET(INDIRECT(ADDRESS(MATCH(A2,$D$2:$D$5,0)+ROW($D$2)-1,COLUMN($D$2),4)),0,1)

    If I remove the absolutes in ROW() and COLUMN() (i.e. use ROW(D2), COLUMN(D2) instead) and allow the cell references to increment as I copy the formula down, I get false positives mixed in with accurate results.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Help with formula OFFSET nested in COUNTIFS

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    11-07-2013
    Location
    Montreal, Qc, Canada
    MS-Off Ver
    Office 365
    Posts
    19

    Re: Help with formula OFFSET nested in COUNTIFS

    If I understand correctly
    if you find value A2 in D2:D5 (yes in D3), you want to know if B2 is not equal to E3.
    but what about if value A2 is not find in D2:D5

    You can try this formula
    =IFERROR(IF(MATCH(A2,$D$2:$D$5,0)>0,IF(B2=INDIRECT("E"&(MATCH(A2,$D$2:$D$5,0)+ROW($D$2)-1)),0,1)),"")

    Regards,
    Rino

+ 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. nested if and offset formula from dropdown list
    By abrazee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2014, 01:45 PM
  2. Combine countifs and offset formula
    By Absalon in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-03-2014, 04:19 PM
  3. [SOLVED] Nested Formula (PRODUCT & OFFSET)
    By alamagan in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-31-2013, 01:39 PM
  4. Using OFFSET with COUNTIFS
    By taketwo in forum Excel General
    Replies: 2
    Last Post: 01-10-2011, 03:45 PM
  5. Replies: 2
    Last Post: 10-08-2009, 09:51 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