Avatar of sandramac
sandramac
 asked on

Complex evaluation

Hello, trying to devise the best way to handle this

Need a way to color fill a cell and add text based on this criteria

If sheet2!U6 or U7 or U8 or U9>35  
or if sheet2!e6 or e7 or e8 or e9 has "TS" anywhere in that cell, (there will be other data in the cell along with possibility of TS in it.)
or if sheet2!o6 or o7 or o8 or o9 is greater than 115 or less then 10, then return with backcolor of cell to Red in addition if U6/U7/U8/U9 was >35 then place "W" in that cell, if TS was in e6/e7/e8/e9 then place "Z" in that cell, if o6/o7/o8/o9 was >115 or <10, then place "T" in that cell.  If all three criteria is found then the cell would be backcolor Red, with W Z T  in that cell.

If sheet2!U6 or U7 or U8 or U9>25  
or if sheet2!e6 or e7 or e8 or e9 has "SN" anywhere in that cell, (there will be other data in the cell along with possibility of SN in it.)
or if sheet2!e6 or e7 or e8 or e9 has "FZ" anywhere in that cell, (there will be other data in the cell along with possibility of FZ in it.)
or if sheet2!o6 or o7 or o8 or o9 is greater than 100 or less then 20, then return with backcolor of cell to Yellow in addition if U6/U7/U8/U9 was >25 then place "W" in that cell, if SN was in e6/e7/e8/e9 then place "S" in that cell, if FZ was in e6/e7/e8/e9 then place "I" in that cell if o6/o7/o8/o9 was >100 or <20, then place "T" in that cell.  If all  criteria is found then the cell would be backcolor Yellow, with W S I T  in that cell.
else the cell backfill is blank and green.
Microsoft Excel

Avatar of undefined
Last Comment
byundt

8/22/2022 - Mon
byundt

Formula for value of first cell:
=IF(COUNTIF(U6:U9,">35"),"W","") & IF(COUNTIF(E6:E9,"*TS*"),"Z","") & IF(OR(COUNTIF(O6:O9,">115"),COUNTIF(O6:O9,"<10")),"T","")

Conditional Formatting for red color in that cell
=AND(H2<>"",SEARCH(H2,"WZT")>0)          'Assumes cell is H2

Formula for value of cell:
=IF(COUNTIF(U6:U9,">25"),"W","") & IF(COUNTIF(E6:E9,"*SN*"),"S","") & IF(COUNTIF(E6:E9,"*FZ*"),"I","") & IF(OR(COUNTIF(O6:O9,">100"),COUNTIF(O6:O9,"<20")),"T","")

Conditional formatting for yellow color:
=AND(H4<>"",SEARCH(H4,"WSIT")>0)
sandramac

ASKER
How would I be able to combine both formulas into the one cell so it is evaluating first for Red, then if nothing meets red, then evaluate for yellow (2nd Formula)
byundt

Formula for Conditional Formatting red color:
=OR(COUNTIF(U6:U9,">35"),COUNTIF(E6:E9,"*TS*"),COUNTIF(O6:O9,">115"),COUNTIF(O6:O9,"<10"))

Formula for Conditional Formatting yellow color:
=OR(COUNTIF(U6:U9,">25"),COUNTIF(E6:E9,"*SN*"),COUNTIF(E6:E9,"*FZ*"),COUNTIF(O6:O9,">100"),COUNTIF(O6:O9,"<20"))
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
sandramac

ASKER
Sorry byundt for not being clear on the task.

I am trying to combine both if statements

=IF(COUNTIF(U6:U9,">35"),"W","") & IF(COUNTIF(E6:E9,"*TS*"),"Z","") & IF(OR(COUNTIF(O6:O9,">115"),COUNTIF(O6:O9,"<10")),"T","") and =IF(COUNTIF(U6:U9,">25"),"W","") & IF(COUNTIF(E6:E9,"*SN*"),"S","") & IF(COUNTIF(E6:E9,"*FZ*"),"I","") & IF(OR(COUNTIF(O6:O9,">100"),COUNTIF(O6:O9,"<20")),"T","")
ASKER CERTIFIED SOLUTION
byundt

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question