+ Reply to Thread
Results 1 to 8 of 8

Countifs with HLookup

  1. #1
    Registered User
    Join Date
    02-08-2018
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    3

    Countifs with HLookup

    Hi all! I'm new to posting to this site (I've previously gotten a lot of expertise from here that i could figure out how to change to what I needed)! I'm hoping you can help with this as well. Here's the situation:

    I want to use a countifs formula (if there's an easier way for you all, fine) to match column A with a study number I have and a column headed as "Max" which will change from sheet to sheet (the location, not the column contents). Ultimately i'm looking to count the cells with >2 in "Max" column for said specific study number in column A on the same sheet. Any help would be much appreciated!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,881

    Re: Countifs with HLookup

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Where column A contains the Study references, the "Max" header reference could be in columns A:M and the specific study to be summed is in cell N1.

    If the Max header could be in a wider range, adjust $A:$M as required.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,881

    Re: Countifs with HLookup

    Sorry, try this for the COUNTIF

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-08-2018
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    3

    Re: Countifs with HLookup

    Can you explain what that means (I'm not all to familiar with the Index function)? So the $A:$A is where I'm searching for the Study Number, I assume N1 is the number I'm looking for, but then what is the A:M reference? Is that the row in the pivot table to search for "Max"?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,881

    Re: Countifs with HLookup

    What Pivot Table? Other than your brief description, I have no idea what your data/worksheet(s) look like. You said there would be a column headed "Max" ... you know where it might be, I don't.

    The INDEX($A:$M,0,MATCH("Max",1:1,0)) will search for "Max" in row 1 and return an array of values from that column.

  6. #6
    Registered User
    Join Date
    02-08-2018
    Location
    Philadelphia, PA
    MS-Off Ver
    2010
    Posts
    3

    Re: Countifs with HLookup

    Apologies, the data is in a pivot table. What is the A:M in your formula referring to? Is that the full potential pivot table (as noted, it will vary in size from small to very large). So my pivot starts right now at A7 but the last row and column in my doc is XFD1048576. When I run the formula for just the index, i'm getting a return of 0.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,881

    Re: Countifs with HLookup

    OK, I still do not know what your workbook, worksheets, data, Pivot Table(s) etc look like. I can't second guess this stuff and I'm not going to be trying to adapt a formula on that basis.

    Post a sample workbook with some typical data and your expected results.

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,662

    Re: Countifs with HLookup

    I suspect you do not have a Pivot Table.
    Cell XFD1048576 is the last cell in the entire worksheet. Do you really have data in every cell


    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to Quick Post button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

+ 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. [SOLVED] HLOOKUP plus COUNTIFS?
    By Minoli in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-27-2015, 03:59 PM
  3. HLOOKUP Help. HLOOKUP links to Drop down list problems
    By finalmike in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2013, 07:08 PM
  4. COUNTIFS OR...multiple countifs without duplication in the numbers
    By HooligaD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 09:53 AM
  5. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  6. HLOOKUP in HLOOKUP, Base Estimate Table in Excel
    By gqdallas in forum Excel General
    Replies: 20
    Last Post: 10-19-2009, 01:41 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