I have applied the conditional formatting in B1 with the formula =IF(AND(A1<>"APPLE",B1<>""),TRUE,FALSE). By this formula, I am telling Excel to highlight the cell B1 in red when B1 has any number but A1 does not have "Apple". Just to simply it what exactly I want is if A1 does not have "Apple" and B1 has any number, highlight B1 in red. The above formula is working fine for me.
But here is my problem. Now what i want is if A1 does not have either "Apple" or "Mango" and B1 has any number, highlight B1 in red. I tried with the formula =IF(AND(OR(A1<>"APPLE",A1<>"MANGO"),B1<>""),TRUE,FALSE) This formula is not giving me desired result.
Could you please advice me what changes i need to make to be able to get the desired result.
Try
AND(A1<>"APPLE",A1<>"MANGO",B1<>"")
You can drop the IF because AND already returns TRUE/FALSE
Related
Trying to define a conditional cell that highlights the value in A1 when that value is not equal to the sum of values in B1 and C1, but excluding when B1 and/or C1 is blank
In the mockup below, only A3 should be highlighted.
I have tried with numerous formulas, none of which works correctly:
=SUMIF(B1:C1,"<>",B1:C1)
=IF(OR(ISBLANK(B1),ISBLANK(C1)),"",B1:C1)
=SUM(IF(COUNTBLANK(B1:C1),"",SUM(B1:C1))B1:C1)
Many thanks for indicating my error!
You want to highlight A only when B and C are not blank and A is not equal to B+C so something like AND(B1<>"",C1<>"",A1<>B1+C1) should work for you
Is there a way to create a formula in one cell that will change the value in another cell based on some criteria, without scripting? Example: cell a1 contains a numerical value. cell b1 contains a value from a drop-down list, say, "YES,NO". If cell b1 is set to "YES" I want to remove (set to zero) the value in cell a1. What I'd like to do is have a formula in cell c1 that interrogates b1 and sets the value in a1 accordingly. Is the only way achieve this writing code and using setValue?
you cant remove it without a script. you can visually hide it in various ways. if the A1 is subject of further sum (as in your case per your comment) the sum formula can be always altered to reflect desired output. example:
if your formula is
=SUM(A1, C5, D22)
you can do
=SUM(IF(B1="YES", 0, A1), C5, D22)
Use the following on the cell you need the calculation (or zero) on:
=IF (B1="YES",0,SUM(A:A))
Using the given formula, you would do the SUM calculation for the whole Column A if the value on B1 is "YES", if not, then a 0 would be placed on the cell you put the formula on.
If I have colors going from cells B1-B6 (Red, Orange, Yellow, Green,Blue,Purple)
And then a sentence/string in cell A1 - (There was a orange box).
I want a formula in cell C1 where if there is a match on any of the keywords, that is should spit out the keyword it matched. Attached is a screenshot example.
I would also want this formula in C1 to be able to drag down and have it "auto-fill". So that if I put any sentence in cell A2, it should repeat the formula in C1, but for this new cell of A2 automatically.
Use the formula:
=XLOOKUP(1,--ISNUMBER(SEARCH(B1:B6,A1)),B1:B6,"no match",2) in the "C" Column.
it will work!
I am trying to do a conditional formatting in excel where if someone types in a number in B1, and if it is not multiples of a number in cell A1, then turn red.
for example if A1 is 5, I want cell B1 to turn red when they type in number which is not multiples of 5, in other words, turn red if cell B1 is not 5,10,15,20,25.......
=and(A1<>B1"",A1<>B1)
this is what I have so far, but this would only work if B1 is empty and if B1 is not equal to A1. I can't figure out how to write in formula in such way that it would only become red when it is not multiples of a number.
Please help, Thanks in advance.
Excel provides MOD function. The syntax is MOD(number, divisor). It returns the remainder of number / divisor.
So if B1 shall turn red when it's value is not a multiple of A1, then following formula for conditional formatting in B1 can be used:
=(MOD(B1,A1)<>0)
As MOD(B1,A1) returns the remainder of B1/A1, this is only 0 if B1 is a multiple of A1. So if it is not equal 0, then conditional formatting shall be triggered to format cell red.
In Excel 2010, I want cell A1 to have the same value as cell A2. So I set a formula in A1:
=B1
that works fine if B1 has a value. But, if B1 is empty, then A1 shows "0". I want A1 to be empty if B1 is empty.
As a workaround, I'm using the following formula in A1:
=IF(B1="", "", B1)
Is there an easier and more elegant way to set a cell to the same value as other cell? (without VBA)
That's the way Excel works I'm afraid. =B1 will display a zero if B1 is empty. Futhermore ISNNUMBER(B1) will return True. So it is a genuine zero, not something formatted as a zero.
A common workaround is to use something like:
=IF(ISBLANK(B1), "", B1)
which, I think, is more elegant than an empty string comparison.
Google spreadsheet works exactly as you need. Using
=A1
in B1, you get the desired empty B1 when A1 is empty.
Under Excel Options > Advanced > Display options for this worksheet, is a tick box called 'Show a Zero in Cells that have zero value'. If you un-tick it then your formula will display blank if they result in zero. Only downside is that all cells that have a zero value (not from a formula) will also display blank.