Excel Conditional Formatting for multiples of a number - excel

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.

Related

Conditional cell for incorrect value excluding blanks

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

Google Sheets or Excel: setting the value of a remote cell from a formula

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.

Excel Conditional Formatting Percentage of Two cells

What I'm trying to do is format, say, cells A1 and B1 to be highlighted in red, when B1 is 80% or greater of what is in cell A1.
For example.
A1 = 10
B1 = 8
In this, I would want to have both cells highlighted in red, since B1 is 80% of A1.
If they were....
A1 = 10
B1 = 6
then they would simply stay the same without any formatting since it is only 60%.
In the Ribbon: Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. In "Format values where this formula is true":
=($B$1/$A$1)>=0.8
You want to apply this formatting to A1 and B1, which can either be done in "manage rules" form box or simply by highlighting the cells you want it to apply to before setting the conditional format.

IF/AND/OR statements

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

How to autofill the condition in conditional formatting in Excel?

Column A has a number 1-10. Column B has a string I want to highlight with conditional formatting. How do I make it so that if the number in Column A is greater than 7, the cell in the same row in Column B will automatically turn blue?
I use the conditional formatting tool for cell B1 such that, in the "Use a formula to determine which cells to format" option, I have ="IF($A1 > 7)", then fill the cell with blue.
But, as I drag/autofill down, the 1 in $A1 does not become A2, A3, A4, A5, A6, etc. as I want it to. What am I doing wrong?
Change the formula to:
=$A1 > 7
And take a look at my yoursumbuddy post, which explains why you don't need IFs in Conditional Formatting:
Select B1, then column B (This should make all the cells bluish except the cell B1, which is said to be the 'active' cell).
Open up conditional formatting and use the formula:
=IF($A1 > 7, 1)
You need to at least specify the value if true and there's no need to drag the conditional formatting down.

Resources