+ Reply to Thread
Results 1 to 10 of 10

COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

  1. #1
    Registered User
    Join Date
    02-03-2012
    Location
    Bangalore, INDIA
    MS-Off Ver
    O365
    Posts
    54

    COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    Hello Expert's,

    1) I need to find the student names who are in Top 25 based on Dynamic inputs(exam numbers) entered in Cell O7 & O8, P7 & P8, Q7 & Q8, R7 & R8.

    2) Please refer enclosed Workbook is self explanatory & detailed requirement in "Sheet 1" worksheet.

    Thanks in Advance!
    Attached Files Attached Files
    Last edited by raptor_k7; 12-02-2022 at 12:04 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    In O11

    =SUMPRODUCT(($B$11:$K$35=$N11)*($B$10:$K$10>=O$8)*($B$10:$K$10<=O$9))

    Copy across and down

    Top 25 based on what criteria ?
    Last edited by JohnTopley; 11-27-2022 at 03:21 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    02-03-2012
    Location
    Bangalore, INDIA
    MS-Off Ver
    O365
    Posts
    54

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    Thank You for your solution. But it gives less count only for some students. I tried with different values in "O8" & "O9" and compared the same with existing formula. Only some students count are mismatching. Kindly look in to it.
    Please find enclosed screenshot.

    Top 25 based on the criteria of highest marks(Largest to Smallest - Top 25) obtained by the students. Attachment 806788

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    Please try for the whole table (inclusive Student names) in one go:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    If you replace the SORT parameter 2 nearly at the end of the formula by IFNA(MATCH(1,LEN(N10:R10),0),2) you can sort the table by placing 1 character in the column you want to sort by.
    Attached Files Attached Files

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    Another way to enable sorting is by using a data valadation list in S10, in which the user can select the column on which the table should be sorted.

    In this case, the SORT parameter is MATCH(S10,N10:R10,0)
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    Given Hd's reply (selecting a column to SORT): IMHO it would be better to have a single column and select the exam ranges and sort on this column

    Sorting on column N and (say Q) is confusing because columns O, P and R are "mis-represented" after the sort.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    @JT, I built the SORT in a similar way that the OP could sort its original sheet of post #1 as well

  9. #9
    Registered User
    Join Date
    02-03-2012
    Location
    Bangalore, INDIA
    MS-Off Ver
    O365
    Posts
    54

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    Thank You, Solved!

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: COUNTIF from Dynamic Range based on Cell Input - Multiple Columns

    Thanks for the feedback and rep . I'm glad to have helped.

+ 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. Dynamic Countif based on columns (which is not fixed)
    By sanjay.k in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2022, 01:33 PM
  2. Change values based up a search of multiple columns in a dynamic range?
    By rob.callaghan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2021, 07:53 AM
  3. [SOLVED] Chart with dynamic range based on user input
    By vizzkid in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-25-2018, 10:36 AM
  4. Countif formula based on dynamic range
    By sanits591 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2016, 04:09 AM
  5. XIRR with dynamic range based on date input (OFFSET)
    By TripleG-CO in forum Excel General
    Replies: 9
    Last Post: 06-29-2015, 08:06 PM
  6. Dynamic Named Range based on Pivot Table for MULTIPLE COLUMNS
    By Pho6 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-29-2014, 02:04 PM
  7. Match a cell with dynamic range (multiple columns)
    By bgonen in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2011, 05:34 AM

Tags for this Thread

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