mardi 21 avril 2015

Having hangup with IF AND OR functions. Need one last tweak

Disclaimer: I have never written code in Excel before. I have been building something for work during few days. I have an formula that WORKS! But there is one adjustment that I need to make, that I cannot make happen. Here is what I have. (Again, if its messy, I have no idea, but its currently working).

=IF(AND(D5="Yes LSC, PA's passed")*F5>G5-20,"AT0 Cannot be in same month as W/D",IF(AND(D5="Yes LSC, PA's not passed")*F5>G5-20,"AT0 Cannot be in same month as W/D",IF(AND(E5="Yes, systematic W/D")*F5>G5-20,"AT0 Cannot be in same month as a systematic W/D","")))

Background: I need an excel spreadsheet that we give to new employees as a "cheatsheet" It gives them prompts (I.E "Yes, LSC passed, or Yes, W/D"). They select the prompts and pass to a supervisor for processing.

Goal: I'm trying to write a formula that does not allow simple errors. For example. For my purposes, I know Cell G5 must be AT LEAST 20 greater than F5. So I want an error message to appear every time they try to enter a value that breaks that rule. (Saves management time) And all of that WORKS!

Problem: If G5 is BLANK...It still gives me the message that I've told it to. However, IF G5 is BLANK, I don't need any of the formula to run. I have been trying to build this exception into my amateur formula but I cant get it.

I can understand whats happening.... Excel recognizes that if G5 is blank...then F5>G5-20 is TRUE -- And it gives me text that I want!! But I need an exception... I need it say understand that if G5 is BLANK, then I don't care about F5>G5-20. It can ignore the ENTIRE formula.

Any suggestions? I hope this makes sense.

Aucun commentaire:

Enregistrer un commentaire