+ Reply to Thread
Results 1 to 9 of 9

Formula that returns Pass if 3 cells have the value of P

  1. #1
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Formula that returns Pass if 3 cells have the value of P

    Hello!

    I was wondering how i could adapt the IF formula to look in 3 cells to see if they have the letter P and if all cells have the letter P the formula returns the value Pass in a specific cell.

    I am currently using the formula below and it does not return Pass if there are P's in all of the cells.

    Please Login or Register  to view this content.
    I hope some one can help!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula that returns Pass if 3 cells have the value of P

    Try changing ROWS to COLUMNS

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula that returns Pass if 3 cells have the value of P

    Almost. Try

    =IF(COUNTIF(AU12:AW12,"P")=COLUMNS(AU12:AW12),"Pass","Failed")
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  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: Formula that returns Pass if 3 cells have the value of P

    Replace the ROWS function with the COLUMNS function.

    =IF(COUNTIF(AU12:AW12,"P")=COLUMNS(AU12:AW12),"Pass","Failed")

    Or, you could just use 3:

    =IF(COUNTIF(AU12:AW12,"P")=3,"Pass","Failed")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Re: Formula that returns Pass if 3 cells have the value of P

    Trust it to be something so simple!

    Rookie Mistake!

    Thanks for your help!

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

    Re: Formula that returns Pass if 3 cells have the value of P

    Another way without having to know or calculate how many cells are involved...

    Array entered**:

    =IF(AND(AU12:AW12="P"),"Pass","Failed")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  7. #7
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Re: Formula that returns Pass if 3 cells have the value of P

    Could i adapt this formula so that if there is one it says for example half complete or semi complete

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula that returns Pass if 3 cells have the value of P

    =IF(COUNTIF(AU12:AW12,"P")=ROWS(AU12:AW12),"Pass","Failed")

    So if NONE are P, then "Failed"
    If SOME but not ALL are P, then "Semi Complete"
    If ALL are P, then "Pass"

    ?

    Try
    =IF(COUNTIF(AU12:AW12,"P")=COLUMNS(AU12:AW12),"Pass",IF(COUNTIF(AU12:AW12,"P")=0,"Failed","Semi Complete"))

  9. #9
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Re: Formula that returns Pass if 3 cells have the value of P

    Quote Originally Posted by Jonmo1 View Post
    =IF(COUNTIF(AU12:AW12,"P")=ROWS(AU12:AW12),"Pass","Failed")

    So if NONE are P, then "Failed"
    If SOME but not ALL are P, then "Semi Complete"
    If ALL are P, then "Pass"

    ?

    Try
    =IF(COUNTIF(AU12:AW12,"P")=COLUMNS(AU12:AW12),"Pass",IF(COUNTIF(AU12:AW12,"P")=0,"Failed","Semi Complete"))
    Thanks JonMo1 big help!

+ 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. Replies: 5
    Last Post: 07-15-2015, 07:01 PM
  2. Formula returns #VALUE due to blank cells
    By katieshields in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2014, 03:57 AM
  3. Hide cells when formula returns a zero value
    By Shan1monkey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-27-2013, 12:33 AM
  4. Hide cells where a formula returns a zero value
    By Shan1monkey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-25-2013, 06:15 PM
  5. [SOLVED] Remove Blank Cells Formula when prior formula returns blanks
    By gmsninja in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2013, 03:39 AM
  6. Formula which returns result in two seperate cells
    By ogreville in forum Excel General
    Replies: 1
    Last Post: 09-27-2011, 03:36 PM
  7. Pass Variable Cells into an Array Formula
    By ZLPROG in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-06-2011, 05:29 AM

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