Conditional Formatting using formula range does not work

pto160

Active Member
Joined
Feb 1, 2009
Messages
482
Office Version
  1. 365
Platform
  1. Windows
I am trying to use conditional formatting using a formula with a range. I am not getting the results that I want. Can you use a formula with a range for conditional formatting:
The condition is numbers with the last two numbers after the decimal point that end in a odd number and any cell that has N.

Book1
ABCDEF
1What I am getting
2156.23NYNTRUE
3180NNN
4192.56YYN
5
6What I want
7156.23NYN
8180NNN
9192.56YYN
Sheet1
Cell Formulas
RangeFormula
F2F2=OR(1*RIGHT(FIXED(A2,2,1),2)>0,C2="N",D2="N",E2="N")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:E4Expression=OR(1*RIGHT(FIXED(A2,2,1),2)>0,C2="N",D2="N",E2="N")textNO
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try:

Book1
ABCDEF
2156.23NYNTRUE
3180NNN
4192.56YYN
Sheet14
Cell Formulas
RangeFormula
F2F2=OR(1*RIGHT(FIXED(A2,2,1),2)>0,C2="N",D2="N",E2="N")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:F4Expression=OR(A2="N",ISNUMBER(FIND(RIGHT(FIXED(A2,2)),"13579")))textNO


Do you really want A4/A9 highlighted since it ends in an even number?
 
Upvote 0
The condition is numbers with the last two numbers after the decimal point that end in a odd number and any cell that has N.
In listing your conditions, you used AND (meaning, both conditions must be met).
But in your formula, you are using OR, which means only one of those conditions must be met.)
If you truly meant AND, then you should be using an AND formula, and not an OR one.
 
Upvote 0
Sorry, I gave the wrong explanation for the fixed formula.
I wrote the conditional formatting formula based only on numbers that are not .00 after the decimal point.
So 156.23 or 192.56, I want highlighted, but not 180.00 or any number after the decimal point that ends in .00
Eric W or Joe4, Will that change the formula above?
My apologies once again.
 
Upvote 0
Sorry, I gave the wrong explanation for the fixed formula.
I wrote the conditional formatting formula based only on numbers that are not .00 after the decimal point.
So 156.23 or 192.56, I want highlighted, but not 180.00 or any number after the decimal point that ends in .00

Hi,

Try this:

Book3.xlsx
ABCDE
1What you want
2156.23NYN
3180NNN
4192.56YYN
Sheet1041
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:E4Expression=OR(A2="N",IF(N(A2),MOD(A2,1),0))textNO
 
Upvote 0
Thanks jtakw. It is highlighting the correct columns, but also an additional column I don't want highlighted.
I went back to my work data and it is highlighting a column that has a date and time in the cell. I wonder why that is?
Book1
ABCDEF
1What you want
2156.231/11/2022 20:31NYN
3180.185/11/2022 12:31NyN
4192.5612/11/2022 12:31YYN
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:F4Expression=OR(A2="N",IF(N(A2),MOD(A2,1),0))textNO

 
Upvote 0
Thanks jtakw. It is highlighting the correct columns, but also an additional column I don't want highlighted.
I went back to my work data and it is highlighting a column that has a date and time in the cell. I wonder why that is?
Book1
ABCDEF
1What you want
2156.231/11/2022 20:31NYN
3180.185/11/2022 12:31NyN
4192.5612/11/2022 12:31YYN
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:F4Expression=OR(A2="N",IF(N(A2),MOD(A2,1),0))textNO


Date and Time values are Numbers in Excel, that's the reason, you should've shown that in OP.

I'll look into it.

EDIT: How large could the numbers be in Column A ?
 
Upvote 0
Thanks jtakw for the explanation. You are completely correct. Based on your answer, yes the date and time would have numbers after the decimal point.
 
Upvote 0
I edited my post above.

How large can the numbers be in Column A.
And, what are the typical Date values in Column C, (e.g. Year 2000 and later, etc.)
 
Upvote 0
Another question, are the Date values Only in Column C, in your actual data, if so, this would work:

Book3.xlsx
ABCDEF
1What you want
2156.231/11/22 20:31NYN
3180.185/11/22 12:31NyN
4192.5612/11/22 12:31YYN
Sheet1042
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:F4Expression=OR(A2="N",IF(AND(N(A2),COLUMN(A2)<>3),MOD(A2,1),0))textNO
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top