+ Reply to Thread
Results 1 to 8 of 8

Confused using the IF and COUNTIF functions (New to Functions)

  1. #1
    Registered User
    Join Date
    11-11-2016
    Location
    Houston, TX
    MS-Off Ver
    2010, 2013
    Posts
    3

    Confused using the IF and COUNTIF functions (New to Functions)

    I have used Excel for years, just simple stuff here and there. However, i cannot seem to correctly configure what i see as a simple conditional formula. If anyone can help that would be great.


    I have a table that i need to compare two columns in the same row( B & C). If they match i need column E to present "PASS", If they do not match then "FAIL". however, i need the E column in that given row to remain blank if B and C are blank as well.

    i am trying to use this:
    =IF(COUNTIF(B2:B2,">0")*B2=C2,"Pass","Fail")

    However, i obviously get an error, do i need to reverse the IF and COUNTIF functions? or am i using the completely wrong formula? Thanks in advance to anyone that doesn't give a link to another post with examples.

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Confused using the IF and COUNTIF functions (New to Functions)

    Try:

    =IF(AND(B2="",C2=""),"",IF(COUNTIFS($B:$B,C2,$C:$C,B2)>0,"Pass","Fail"))

  3. #3
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Confused using the IF and COUNTIF functions (New to Functions)

    The above works if B and C are both Blank. If you want to check if either are blank then simply change AND to OR

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Confused using the IF and COUNTIF functions (New to Functions)

    Since you're using this test in your formula:

    COUNTIF(B2:B2,">0")
    Can we assume the data is numeric and that it will always be greater than 0?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Confused using the IF and COUNTIF functions (New to Functions)

    Thanks for the rep, if you're issue has now been solved please be sure to mark this thread as solved.



    Thanks again

  6. #6
    Registered User
    Join Date
    11-11-2016
    Location
    Houston, TX
    MS-Off Ver
    2010, 2013
    Posts
    3

    Re: Confused using the IF and COUNTIF functions (New to Functions)

    Will do, i do have ONE more question. I get now the formula breakdown. However what would be the function or condition that Pass or Fail is only filled once both B & C are filled. I need E to remain empty if only either B and C are filled but the other is not. It has to do with E being connected to another data table.

  7. #7
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Confused using the IF and COUNTIF functions (New to Functions)

    As mentioned above (post 3) you need to change AND to OR

    =IF(OR(B2="",C2=""),"",IF(COUNTIFS($B:$B,C2,$C:$C,B2)>0,"Pass","Fail"))

  8. #8
    Registered User
    Join Date
    11-11-2016
    Location
    Houston, TX
    MS-Off Ver
    2010, 2013
    Posts
    3

    Re: Confused using the IF and COUNTIF functions (New to Functions)

    Wow, i did not see that part. My apologies, thank you very much sir. Thread solved.

+ 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. VBA and using workbook functions, confused
    By algebr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2013, 12:01 PM
  2. Help with nested IF functions. Help -- I'm so confused.
    By grannygamer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-19-2007, 06:59 PM
  3. [SOLVED] Confused about arrays and ranges in functions
    By Llurker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. [SOLVED] Confused about arrays and ranges in functions
    By Llurker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  5. [SOLVED] Confused about arrays and ranges in functions
    By Llurker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  6. Confused about arrays and ranges in functions
    By Llurker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. [SOLVED] Confused about arrays and ranges in functions
    By Llurker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. [SOLVED] Confused about arrays and ranges in functions
    By Llurker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10: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