Is using the break statement bad practice?

If statement to consider for blank cells

  • QUESTION: Good Day, I am building anform, using an If statement. I was able to determine the formula for if information is entered in the 3 cells to prompt a response. =IF(AND(Q24>0,W24>0,AC24>0),((((Q24/N24)+(W24/T24)+(AC24/Z24))/3)*100),"") However I would also like to add conditions for the combination of cells for example: Q24 only, W24 only, AC24 only, Q24 and AC24, Q24 and W24, W24 and AC24. How to I add another If statement with another criteria to be met? ANSWER: I don't clearly understand your last question. So you want to change it to just be Q24 only? then just make the first argument be Q24>0 Or what exactly are you asking? Just give me an example of one thing you want to do. By the way, cells can have a lot of weird things in them other than just 0 or not 0. I would recommend always evaluating the LEN of the cell, it's a better programming practice than the habit of using 0 / not 0, or "" ---------- FOLLOW-UP ---------- QUESTION: No sorry for not being clear: there are 3 cells the calculation must be able to be computed for combinations as it is not a requirement that all cells have a value therefore i want an if statement for the criteria to be met to account for any situation. For example if one cell has a value, 2 cells have a value or if all 3 cells. I have the condition for all 3 cells which is =IF(AND(Q24>0,W24>0,AC24>0),((((Q24/N24)+(W24/T24)+(AC24/Z24))/3)*100),"").

  • Answer:

    Ok, I think I understand. So the basic thing that needs to happen is, Q24/N24)+(W24/T24)+(AC24/Z24))/3)*100 And you want this to happen, IF, any one of the three cells is not blank. Then just change your formula to this: IF(OR(Q24>0,W24>0,AC24>0),((((Q24/N24)+(W24/T24)+(AC24/Z24))/3)*100),""). Or if you are saying you want, let's say, 2 different possibilities WITH 2 DIFFERENT POSSIBLE RESULTS, then use this: =IF(AND(len(Q24)>0,len(W24)>0,len(AC24)>0),((((Q24/N24)+(W24/T24)+(AC24/Z24))/3)*100),if(len(q24)>0,ANOTHER RESULT,"")) I also changed the "greater than zero" things to be a length-checker, as I originally recommended.

Miningco.com Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.