+ Reply to Thread
Results 1 to 8 of 8

Vlookup with nested IF's or CountIF's

  1. #1
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Vlookup with nested IF's or CountIF's

    Hi guys, hopefully you can shed some light onto this small problem I am having.

    The current formula I'm trying to use is:

    =IF(VLOOKUP(A4,EPG1!D4:AN26,6,FALSE),COUNTIF(PASS,""))+IF(VLOOKUP(A4,EPG1!D4:AN26,6,FALSE),COUNTIF(FAIL,""))

    This isn't producing the desired results.

    What I am trying to do in words is this:

    IF... in this array it equals A4 then look at coloum 6 and then Countif col 6 says Pass and then add another if it says Fail

    I think I've gotten the syntax mixed up...can anyone guide me?
    Last edited by NBVC; 10-08-2009 at 11:48 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Vlookup with nested IF's or CountIF's

    Maybe?

    =SUMPRODUCT((EPG1!D4:D26=A4)*(EPG1!I4:I26={"Pass","Fail"}))

    this counts how many times Pass or Fail exists in column I, where Column D contains value found in A4
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Vlookup with nested IF's or CountIF's

    This would work, but the problem is the reason I was using vlookup is becasue I want to correspond that that match

    If I use simproduct it will add all the PASS/FAILS which might be a pass/fail for someone else.

  4. #4
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Vlookup with nested IF's or CountIF's

    My mistake, works perfectly....

  5. #5
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Vlookup with nested IF's or CountIF's

    Thank you for your great help.. I've entered in the formula...As you'll see below...

    Is there any way to compact this?


    =SUMPRODUCT((EPG1!D$4:D$26=A4)*(EPG1!F$4:F$26={"Pass"}))+SUMPRODUCT((EPG1!D$4:D$26=A4)*(EPG1!G$4:G$26={"Pass"}))+SUMPRODUCT((GAW4!D$4:D$26=A4)*(GAW4!F$4:F$26={"Pass"}))+SUMPRODUCT((GAW4!D$4:D$26=A4)*(GAW4!G$4:G$26={"Pass"}))+SUMPRODUCT((KT16!D$4:D$26=A4)*(KT16!F$4:F$26={"Pass"}))+SUMPRODUCT((KT16!D$4:D$26=A4)*(KT16!G$4:G$26={"Pass"}))+SUMPRODUCT((KF10!D$4:D$26=A4)*(KF10!F$4:F$26={"Pass"}))+SUMPRODUCT((KF10!D$4:D$26=A4)*(KF10!G$4:G$26={"Pass"}))+SUMPRODUCT((WLBC!D$4:D$26=A4)*(WLBC!F$4:F$26={"Pass"}))+SUMPRODUCT((WLBC!D$4:D$26=A4)*(WLBC!G$4:G$26={"Pass"}))+SUMPRODUCT((BROP!D$4:D$26=A4)*(BROP!F$4:F$26={"Pass"}))+SUMPRODUCT((BROP!D$4:D$26=A4)*(BROP!G$4:G$26={"Pass"}))+SUMPRODUCT((SALX!D$4:D$26=A4)*(SALX!F$4:F$26={"Pass"}))+SUMPRODUCT((SALX!D$4:D$26=A4)*(SALX!G$4:G$26={"Pass"}))+SUMPRODUCT((JK09!D$4:D$26=A4)*(JK09!F$4:F$26={"Pass"}))+SUMPRODUCT((JK09!D$4:D$26=A4)*(JK09!G$4:G$26={"Pass"}))

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Vlookup with nested IF's or CountIF's

    If you download and install a free addin from here: Morefunc.xll

    You can use:

    =SUMPRODUCT((THREED(EPG1:JK09!D$4:D$26)=A4)*(THREED(EPG1:JK09!F$4:G$26)="Pass"))

    Note: EPG1 is first sheet, JK09 is last sheet...

    Note also: This addin is embeddable in the workbook so that you can share it without having to reload the addin elsewhere.

  7. #7
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Vlookup with nested IF's or CountIF's

    I love it!!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Vlookup with nested IF's or CountIF's

    Great.. I am glad that works for you.

    Can you please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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