+ Reply to Thread
Results 1 to 7 of 7

I tried but failed (Countif based questions)

Hybrid View

  1. #1
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: I tried but failed (Countif based questions)

    COUNTIFS can't handle arrayed inputs, which is what's going to happen with your LEFT. So what you want is directly impossible, but there are still ways to handle it.

    There are two ways I would do this:

    1) Add a helper column, for example insert a new column next to CG that will be your new CH, and fill it with:
    CH2 = LEFT(CG2, 2)
    pull down

    And then use that column CH as the condition for the COUNTIF instead of column CG.



    2) Use an array-type formula instead of COUNTIFS.

    For now, I'm putting this additional text in:
    sheet1!A3 = "XJ"
    that I will be using as a comparitor instead of the full name in sheet1!A4.

    2.1) Using SUMPRODUCT()
    =SUMPRODUCT(--(LEFT('MYNM Jaguar'!$CG$2:$CG$2000,2)=$A$3), --('MYNM Jaguar'!$S$2:$S$2000>=B$3), --('MYNM Jaguar'!$S$2:$S$2000<=B$4))
    2.2) Using {SUM(IF(array))}
    {=SUM(IF(LEFT('MYNM Jaguar'!$CG$2:$CG$2000,2)=$A$3,1,0)*IF('MYNM Jaguar'!$S$2:$S$2000>=B$3,1,0)*IF('MYNM Jaguar'!$S$2:$S$2000<=B$4,1,0))}
    Note that, as a array formula, this has to be executed with CTRL+SHIFT+ENTER instead of just hitting ENTER.




    See attached for a demonstration of how these would work.
    Attached Files Attached Files

+ 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. Dependent Questions Based on Answers
    By oua in forum Excel General
    Replies: 2
    Last Post: 11-07-2013, 10:27 AM
  2. Problem based learning questions
    By fakersatlive in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-29-2013, 06:32 AM
  3. [SOLVED] Failed Lookup based on small function
    By MattRNR in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-20-2013, 09:03 PM
  4. Color coding certain rows based on answers to questions?
    By brittany182 in forum Excel General
    Replies: 1
    Last Post: 02-22-2013, 04:22 PM
  5. [SOLVED] Countif accross multiple questions.
    By golden in forum Excel General
    Replies: 1
    Last Post: 10-28-2005, 01:05 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