+ Reply to Thread
Results 1 to 5 of 5

Conditional formating and If formula used together

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Conditional formating and If formula used together

    I have a spreadsheet that has a data validation in cells c10 thru c18. User can select either Yes, No or N/A in those cells. In Cell A20 if any of cells c10 thru c18 equal No, I want cell A20 to read Fail highlighted the cell in red with white font. If all of those cells equal Yes, then A20 would read Pass highlighted in green with white font. I am having a terrible time trying to figure this out. TIA!

  2. #2
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: Conditional formating and If formula used together

    set conditional formatting in A20 using formula ="Fail" set formatting to red etc...
    Then set ANOTHER conditional formatting ="Pass" and set green formatting

    if neither condition is met, not formatting will show. (One cell can have more than one conditional formats - as long as there is no conflict)

    -also if you highlight the column (beginning with A20 and highlighting through A50 etc..) and yoou set the conditional formatting formula as =$A20="xxx" then the condition will be present in all the cells
    Last edited by CRIMEDOG; 12-03-2012 at 11:02 AM.

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Conditional formating and If formula used together

    hi Triscia, use this formula in A20:
    =IF(COUNTIF(C10:C18,"no"),"Fail",IF(COUNTIF(C10:C18,"Yes")=9,"Pass",""))

    you can then do a conditional formatting on A20 by going to Home -> Conditional Formatting -> Highlight Rules -> Equal to:
    Pass
    adjust the colour to a custom format you want.

    repeat action for "fail"

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Conditional formating and If formula used together

    in A20
    =IF(CountIF(C10:C18,"No")>0,"Fail","Pass")


    Highlight A20, Conditional Formatting >Highlight Cell Rules>Equal To "Pass" with custom format, choose cell color and font color
    repeat for the "Fail" condition

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  5. #5
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Conditional formating and If formula used together

    A20 keeps showing False instead of Fail. That is weird. I have the formula exactly the same. I also tried the reponse below and I still got a False return.

+ 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