+ Reply to Thread
Results 1 to 4 of 4

Count values in dynamic column greater than another

  1. #1
    Registered User
    Join Date
    02-24-2019
    Location
    UK
    MS-Off Ver
    MS 365 PC & Mac (assume PC unless otherwise stated in post)
    Posts
    96

    Count values in dynamic column greater than another

    I am trying to count all the values in column B that are greater than column C (on the same row) i.e B2 vs C2, B3 vs C3, B4 vs C4, the actual columns will change dynamically and I thought to use MATCH (as below) to identify column.

    I had hoped following formula would work to avoid using INDIRECT and trying to keep it relatively simple as I will be evaluating thousands of rows of data.

    =SUMPRODUCT(--(Index(tableA,0,match(A2,tableA[#Headers],0))> Index(tableA,0,match(NameXYZ,tableA[#Headers],0))))

    Any suggestions gratefully received.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Count values in dynamic column greater than another

    Why not just use

    =SUMPRODUCT(--(B:B>C:C))

    or if in a table, something like

    =SUMPRODUCT(--(TableA[Colum B Header]>TableA[Colum C Header]))

  3. #3
    Registered User
    Join Date
    02-24-2019
    Location
    UK
    MS-Off Ver
    MS 365 PC & Mac (assume PC unless otherwise stated in post)
    Posts
    96

    Re: Count values in dynamic column greater than another

    Thanks for the reply, the basic formula you propose is what I am aiming for but the columns are dynamic, I.e won’t always be column B and C.

  4. #4
    Registered User
    Join Date
    02-24-2019
    Location
    UK
    MS-Off Ver
    MS 365 PC & Mac (assume PC unless otherwise stated in post)
    Posts
    96

    Re: Count values in dynamic column greater than another

    So seems my original formula (see below) does actually work, I altered the formatting of the table headers and this resolved my #N/A

    =SUMPRODUCT(--(INDEX(TableA,0,MATCH(A2,TableA[#Headers],0))>INDEX(TableA,0,MATCH(NameXYZ,TableA[#Headers],0))))

+ 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. Count Unique items in one column if values in other column is greater than zero
    By SanjivManiktala in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-24-2018, 02:52 PM
  2. Replies: 1
    Last Post: 11-19-2015, 10:34 AM
  3. [SOLVED] count values greater 2 or greater in a column.
    By ammartino44 in forum Excel General
    Replies: 3
    Last Post: 09-16-2014, 07:05 PM
  4. [SOLVED] Count textbox values greater than 0
    By []dre in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2013, 09:36 PM
  5. [SOLVED] Trying to count cells greater than # in one column if another column meets criteria
    By lorne17 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-14-2012, 07:01 PM
  6. Count values greater than zero
    By skatmandu2002 in forum Excel General
    Replies: 2
    Last Post: 12-02-2009, 07:26 PM
  7. Count values greater than zero
    By famico78 in forum Excel General
    Replies: 4
    Last Post: 12-10-2008, 10:02 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