Conditional formatting: combining multiple checks - excel

Right now I check if a cell is blank, if it is, it becomes red.
=ISBLANK($B$12)
However this cell only needs to be red when it's empty AND another condition is met: the cell above needs to be set to "YES" or blank.
I tried doing something like:
=ISBLANK($B$12),($B$11)=!"NO"
But that doesn't really work.

The AND function can combine the logic in the manner you are looking for. Try the following,
=AND(ISBLANK($B$12), NOT($B$11="NO"))
'or,
=AND($B$12="", $B$11<>"NO")
You will likely want to remove the $ absolute anchor from either the row or column if you want to apply that condition to more than a single cell.
These formulas are applied with the 'Use a formula to determine which cells to format' option. They are put into the 'Format values where this formula is true:' text box.
 

You could check for the cell being blank and above being "YES" with the following:
=AND(ISBLANK($B$12),EXACT($B$11, "YES"))

Related

Conditional Formatting Depending on Text In Separate Cells in Excel

I'm trying to have one column change color (individual cells in that column, rather) depending on if there is text in a different cell in the same row. I've tried using something along the lines of =IF(($B1<>""), TRUE, FALSE) and that works, but when I try to copy that formatting to the rest of the column, the cell number that the formula references stays the same, so every cell in column A will reference cell B1 instead of changing the reference cell to B2, B3, etc... on down the column.
The problem with your formula i'm assuming is the $ sign which is an absolute reference. So if you use $B1 in your formula, you're saying that you need to always compare against the value in column B.
using this formula should probably work for you:
=IF(B1<>"", TRUE, FALSE)
But it also depends on the range that you're applying this conditional-format on.
TIP:
You don't even have to use the IF function, B1<>"" returns TRUE or FASLE by default.

Excluding header in conditional formatting function which is using TODAY()

My formula is the following one, I want the cell green if cell value is not "" and it's greater than today.
=AND(F1<>"";F1>=TODAY())
The thing is it applies to the whole column =$F:$F, and I have a header with text, which is filled with green.
I know I can execute the formula beginning at the first date value, but is there any way to exclude text values to this formula, or maybe some IFNUMBER, if exist?
check ISNUMBER and combine it with your formula.
Or use and extra condition, something like =AND(F1<>"";F1>=TODAY();ROW(F1)<>1)
Exclude row 1 (if row 1 is the header row, ofc)
=AND(ISNUMBER(F1);F1>=TODAY())

How can I automaticly color a cell based on another cells content that I know?

I´m trying to fill a Cell based on the words "beim Baum." which could appear in different cells in the same line. If this is true for any cell I want a particular cell to turn yellow. All cells contain words or numbers and are formatted as numbers.
So for example cell A1 contains "beim Baum." so I would like B1 to turn yellow. it should also turn yellow if C1 contains "beim Baum."
I know the conditional formatting formula for filling in a cell based on an exact word would be Rule $A1="beim Baum." Applies to =$B1, but this does not work.
I also tried: =SEARCH("beim Baum.",$B1)
and: =ISNUMBER(SEARCH("beim Baum.",$B1))
No matter which formula nothing happend
The ISNUMBER SEARCH approach is correct.
Lets have complete example:
Conditional formatting rule based on formula:
=ISNUMBER(SEARCH("beim baum",$A1&$C1))
is applied to =$B$1:$B$8.

Excel Conditional Formatting, Referencing 2 cells to the Right with conditions

I have a list of students who are between the ages of 3 and 5. lets say column A has the code, Column D has the childs age & Column F has their age group (3-5) If their age exceeds the age group then the Cell in column A will highlight Red. I am just not sure how to write this code correctly, all of the combinations i have tried come up with an error or just don't do anything.
IF(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,7)="3-5" & (OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,4)>5 {THEN FILL CELL RED} {ELSE NO FILL}
In the first part of the statement you are checking whether the cell 7 columns across = "3-5". You don't need to use offset for this, you can just reference the cell 7 across directly.
So if you're applying the conditional formatting to A1 that part of the formula would just be =IF(H1="3-5",{then},{else}).
If you just want TRUE or FALSE as the answer you don't need the IF statement, so this shortens to: =H1="3-5",
If you're applying the conditional formatting to a range instead of just an individual cell, say A1:B10, then you write the formula for the cell in the top left of the that range. So for A1:B10 you would still you the same formulae as above.
For the second part of the statement, using the same logic as above, you get: =E1>5
To check both statements together you need to wrap them in the =AND() function, giving you this as the final formula for your conditional formatting:
=AND(H1="3-5",E1>5)
By using the AND function I can achieve the desired result without cell references moving if a cell is relocated.
=AND(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,7)="3-5yo",OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,4)>5)

IF statement: how to leave cell blank if condition is false ("" does not work)

I would like to write an IF statement, where the cell is left blank if the condition is FALSE.
Note that, if the following formula is entered in C1 (for which the condition is false) for example:
=IF(A1=1,B1,"")
and if C1 is tested for being blank or not using =ISBLANK(C1), this would return FALSE, even if C1 seems to be blank. This means that the =IF(A1=1,B1,"") formula does not technically leave the cells blank if the condition is not met.
Any thoughts as to a way of achieving that? Thanks,
Unfortunately, there is no formula way to result in a truly blank cell, "" is the best formulas can offer.
I dislike ISBLANK because it will not see cells that only have "" as blanks. Instead I prefer COUNTBLANK, which will count "" as blank, so basically =COUNTBLANK(C1)>0 means that C1 is blank or has "".
If you need to remove blank cells in a column, I would recommend filtering on the column for blanks, then selecting the resulting cells and pressing Del. After which you can remove the filter.
Try this instead
=IF(ISBLANK(C1),TRUE,(TRIM(C1)=""))
This will return true for cells that are either truly blank, or contain nothing but white space.
See this post for a few other options.
edit
To reflect the comments and what you ended up doing: Instead of evaluating to "" enter another value such as 'deleteme' and then search for 'deleteme' instead of blanks.
=IF(ISBLANK(C1),TRUE,(TRIM(C1)="deleteme"))
I wanted to add that there is another possibility - to use the function na().
e.g. =if(a2 = 5,"good",na());
This will fill the cell with #N/A and if you chart the column, the data won't be graphed. I know it isn't "blank" as such, but it's another possibility if you have blank strings in your data and "" is a valid option.
Also, count(a:a) will not count cells which have been set to n/a by doing this.
If you want to use a phenomenical (with a formula in it) blank cell to make an arithmetic/mathematical operation, all you have to do is use this formula:
=N(C1)
assuming C1 is a "blank" cell
You could try this.
=IF(A1=1,B1,TRIM(" "))
If you put this formula in cell C1, then you could test if this cell is blank in another cells
=ISBLANK(C1)
You should see TRUE. I've tried on Microsoft Excel 2013.
Hope this helps.
I've found this workaround seems to do the trick:
Modify your original formula:
=IF(A1=1,B1,"filler")
Then select the column, search and replace "filler" with nothing. The cells you want to be blank/empty are actually empty and if you test with "ISBLANK" it will return TRUE. Not the most elegant, but it's quick and it works.
The easiest solution is to use conditional formatting if the IF Statement comes back false to change the font of the results cell to whatever color background is. Yes, technically the cell isn't blank, but you won't be able to see it's contents.
This shall work (modification on above, workaround, not formula)
Modify your original formula:
=IF(A1=1,B1,"filler")
Put filter on spreadsheet, choose only "filler" in column B, highlight all the cells with "filler" in them, hit delete, remove filter
You can do something like this to show blank space:
=IF(AND((E2-D2)>0)=TRUE,E2-D2," ")
Inside if before first comma is condition then result and return value if true and last in value as blank if condition is false
The formula in C1
=IF(A1=1,B1,"")
is either giving an answer of "" (which isn't treated as blank) or the contents of B1.
If you want the formula in D1 to show TRUE if C1 is "" and FALSE if C1 has something else in then use the formula
=IF(C2="",TRUE,FALSE)
instead of ISBLANK
Here is what I do
=IF(OR(ISBLANK(AH38),AH38=""),"",IF(AI38=0,0,AH38/AI38))
Use the OR condition OR(ISBLANK(cell), cell="")
I think all you need to do is to set the value of NOT TRUE condition to make it show any error then you filter the errors with IFNA().
Here is what your formula should look like =ifna(IF(A1=1,B1,NA()))
Here is a sheet that returns blanks from if condition :
https://docs.google.com/spreadsheets/d/15kWd7oPWQmGgYD_PLz9YpIldwnKWoXPHtHQAT3ulqVc/edit?usp=sharing
Nope ... that only works for Googlesheets ... not Excel.
To Validate data in column A for Blanks
Step 1: Step 1: B1=isblank(A1)
Step 2: Drag the formula for the entire column say B1:B100; This returns Ture or False from B1 to B100 depending on the data in column A
Step 3: CTRL+A (Selct all), CTRL+C (Copy All) , CRTL+V (Paste all as values)
Step4: Ctrl+F ; Find and replace function Find "False", Replace "leave this blank field" ; Find and Replace ALL
There you go Dude!
Instead of using "", use 0. Then use conditional formating to color 0 to the backgrounds color, so that it appears blank.
Since blank cells and 0 will have the same behavior in most situations, this may solve the issue.
This should should work: =IF(A1=1, B1)
The 3rd argument stating the value of the cell if the condition is not met is optional.

Resources