Excel 2010 nested IF AND statment - excel-formula

I have tried to write a statement for the following function,
a question and answer sheet is converting text answers into numbers Yes = 1 No = 4 Maybe = 2 and various other qustions but converting to numbers 1,2 and 4 only
Answer to Question 1 into B1 Question 2 into B2 and Question 3 into B3
I total the section in Cell B4 and populate the cell with a statement depending on the answers some example answers below
IF B1=1,B2=1,B3=1 then it will state "TRUE CONTINUE"
IF B1=4,B2=4,B3=4 then it will state "FALSE STOP"
IF B1=2,B2=1,B3=1 then it will state "TRUE CONTINUE"
SO IN CELL B4 I HAVE THIS STATEMENT
=IF((AND(B1<=3,B2<=3,B3<=3)),"TRUE CONTINUE","FALSE STOP")
Before anyone types any information Cell B4 has the text "FALSE STOP" because I have used the false statement to fill the cell with text instead of leaving it blank.
how can I write the code which leaves the cell B4 blank until all the questions have been answered in Cells B1,B3
I have tried various nested statements using if , and , Or but the code stops working or partially works
thanks Ian

try this (assuming your if statement is doing what its supposed when all answers are entered)
=if(or(B1="",B2="",B3=""),"",IF((AND(B1<=3,B2<=3,B3<=3)),"TRUE CONTINUE","FALSE STOP"))
basically you are saying if any of the cells b1 b2 or b3 is empty/blank display blank. As long as none of the cells are empty do my if statement check.
you can get a little more convoluted and thorough by using a statement like trim(b1) or clean(b1) to ensure someone does not put a space in the cell. a space would make the cell look empty, but from excels point of view its equal to " " instead of "".
On a semi related side note. For data entry cells I usually use conditional formatting and put something like =isblank(B1) as my condition and if its true colour the background of the cell a light shade of yellow or something. As soon as somone makes an entry even if its a space, the cell background will return to normal. Just one way to grab your eye as to what might be going on in cells or highlighting where info needs to go.

Related

Excel with Blank cells and a IF/AND statement

I have cells A1-A7 with A1 needing the formula. Cells A2-A7 have dropdown list options of "Y" or "N". What I'm needing is for A1 to remain blank until a "Y/N" option is chosen for cells A2-A7. Once A2-A7 have data (Y or N) I need them to be evaluated so that if there is a "N" in any cell of A2-A7, then A1 will display "N". If no "N" is input in A2-A7, then A1 will display "Y"
The formula I'm currently using in cell A1 is:
=IF(COUNTBLANK(M3:M7)>0,"",(IF(AND(M3="N",M4="N",M5="N",M6="N",M7="N"),"N","Y")))
This formula is keeping the A1 cell blank no matter what is input into A2-A7. Any ideas?
There's several ways to do this, but the one first coming to mind for me is to rewrite the second part of your formula.
Keep this part, to check if you have all of your cells filled out
IF(COUNTBLANK(M3:M7)>0,"",
Then, I'd use the same method for finding out if any of the cells hold the value "N"
IF(COUNTIF(M3:M7,"N")>0;"N";"Y")
This is a personal choice, but I find reading the code is easier if you use versions of the same function like this.
The whole code would then be
IF(COUNTBLANK(M3:M7)>0,"",IF(COUNTIF(M3:M7,"N")>0,"N","Y"))
PS: I saw in the comment someone suggested splitting the original formula up in different cells to figure out where it goes wrong. There's also a built-in function that allows you to calculate a formula step-by-step and see the results. It's called Evaluate Formula and can be found under the Formula section.

Excel formula for "skipping to write" in cell if conditions are not correct

So I got stuck with a problem where I could use some feedback.
I am looking at cell B1 and C1 if either contains a specific value.
If it does I want to write value from D1 (true or false) to A1.
This is the formula I started with and it's used in A1 (I had to simplify with fruits both due to data protection and simplification):
=IF(OR(B1="Apples";C1="Apples");"D1";"")
The problem now is that I want to "skip" a write if it doesn't contain any of the values but it won't work since the IF statement is left empty.
As you can see in the attached picture, I leave an empty space between each "True".
I did find a lot of solutions on how to "skip" empty cells, but that's not what I am after here. Is this even possible with Excel-formulas or do I need to dig into VBA?
Result of my formula:
Expecation:
Does it make sense?
My manager actually solved this for me if anyone is interested. The use case is a bit weird I can agree on that, but here is solution:
Formula required to "scatter the TRUE's
Formula to get the first TRUE
Formula for the upcoming TRUE's

Excel Highlight one row based on another

I am trying to compare one row with another: IF the cells in Row 1 is equal to Row 2, THEN I must have highlighting. I've tried 100 methods for over an hour now. The problem is that Excel keeps the formula the same across the row!! the formula needs to change, meaning: I am NOT trying to highlight the whole row based on just the first cell, the cell needs to dynamically change. First cell to first cell, 2nd to 2nd, etc.
The circled words need to be highlighted.
Sorry to ensure everyone is clear on the requirement, here is my requirement:
The solution, as a brilliant guy below mentioned, was a stupid $ sign.
If you want the circled words to be highlighted, the "Applies To" field should be "=$A$10,$E$10" - to see what rules are being applied in those cells, they need to be part of the current selection or you need to change the selection in "Show Formatting Rules For" to "This Worksheet."
If you want the comparison to not be absolute, remove the dollar signs.
Also consider adding TRIM() around A9 and A10 in the formula if you don't want stray spaces to lead to a detection of a difference.
change the Formula to = A10 = A9 (or just remove the $'s in yours) and Applies To =$A$10:$E$10

Using H-lookups in excel

I am searching through 1000's of lines of data and I'm looking for specific info in these cells and if it appears id like the end cell to have a tick in or turn red and ect. for easy distinguish.
So in short what I am looking for would be
All Selected cells
if (all cell a-z Contain "Admin"){
Tick cell AA
}
You should check for Admin inside a concatenation of the cells A1:Z1. This concatenation is achieved via A1&B1&C1&...&X1&Y1&Z1. So, for example, in cell AA1, enter
=IF(ISERROR(FIND("Admin",A1&B1&C1&...&X1&Y1&Z1)),"not found","found")
where you replace ... with the remaining cells in the range.
I have worked out a solution to the range issue instead of highlighting all of the cells
=IF(ISERROR(HLOOKUP("admin",A5:G5,1)),"NOT FOUND","FOUND")
Hope this helps anyone else out there.
One way of doing this is as follows. In the cell you want the indicator have the following code, and assuming that you are looking for the value a - replace "a" with the value you are looking for.
=COUNTIF(D8:I8,"a")
You can then use conditional formating that says if the cell is > 0 then turn it red, or have an adjacent field that has a conditional format to put in a traffic light, tick mark, whatever and hide the previous field.
Hope this helps

How to make a cell register if there is text in two other cells in Google spreadsheet

I have a spreadsheet (Google spreadsheet) where I register information about employee´s education. In the bottom of each column (every employee is represented by a column) I want the cell to display "Yes" if there is text in two other specified cells. (Not if there is text in only one of them, or none of them.)
I have tried all kinds of combinations using AND and IF and NOTBLANK, but I probably have the wrong syntax, or use the functions wrong.
So what I need help to understand is if there is text in cell B3 and in cell B34, how can I create a formula that displays the text "Yes" in cell B38?
Please try:
=if(and(not(isblank(B3));not(isblank(B34)));"Yes";"No")
This may cover a wider range of possibilities than you require but it is usually easeir to trim back than to expand. For example, If either B3 or B34 is empty, this formula returns No, rather than nothing at all (but the No is not obligatory) and the "text" in B3 and B34 can be either alpha or numeric, or a mixture.
Please try this, it works:
=IF(OR(ISBLANK(B3),ISBLANK(B34),NOT(ISTEXT(B3)),NOT(ISTEXT(B34))),"No","Yes")
Logic:
If any of Cell B3 or B34 is blank or contains Non-Text value is returns "No". It just returns "Yes" only if both the cells have a "Text" value.
More short and powerful Formula as per your requirement is as follows:
=IF(AND(ISTEXT(B3),ISTEXT(B34)),"Yes","No")

Resources