Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional formatting help.

Status
Not open for further replies.

Melko

Civil/Environmental
Mar 25, 2002
53
I'd like to change a whole row background color if a cell value is odd or not.

Is that possible?
 
Replies continue below

Recommended for you

Hello,

I think I may have found a work around.

I am trying to format row 10.

In A1 enter =A10/2
In A2 enter = =MOD(A1,1)

In A10 get the conditional formatting menu up and change CONDITION 1 to FORMULA IS and enter =$A$2>0, select the format you require.

USe the format painter from cell A10 and target row 10, i.e. select Cell A10 highlight the format painter and select 10 on the ROW HEADINGS.



maybe only a drafter
but the best user at this company!
 
Hello,

Just realisd my earlier reply only works for whole numbers.
A better way would be to enter this formula in A1
=IF(ISEVEN(A10),1,0)

The conditional format is then = $A$1=0





maybe only a drafter
but the best user at this company!
 
I'll try to explain better...

I have a long list of data and in the first column I have a date.
1/1/3 DATA DATA DATA ect.
2/1/3 DATA DATA DATA ect.
5/1/3 DATA DATA DATA ect.
5/1/3 DATA DATA DATA ect.
5/1/3 DATA DATA DATA ect.

I made a formula that detects the change of the date alternating a 0 and a 1

1/1/3 DATA DATA DATA ect. 1
2/1/3 DATA DATA DATA ect. 0
5/1/3 DATA DATA DATA ect. 1
5/1/3 DATA DATA DATA ect. 1
5/1/3 DATA DATA DATA ect. 1

So in order to make the sheet more readable I'd like to change the backgroun of all cell of every row in a color if the last column is a 0 or a 1 .
Is possible select the whole table and do so in a command?
 
Select the whole row you want to change.

Go to Conditional Formatting.

For your condition, use "Formula Is" rather than "Cell Value Is".

Insert one of the following the formulas:

If you have the Analysis Tool Pak installed:
=IF(ISEVEN($A$1),0,1)

Alternatively:
If you want to check for odd whole numbers only:
=IF($A$1/2=TRUNC($A$1/2),0,1)

If you want to check if the integer of a decimal number is odd:
=IF(INT($A$1)/2=TRUNC(INT($A$1)/2),0,1)

If the number in cell A1 is odd, the format will be applied to the whole row.
If the number in A1 is even, the format will not be applied.
 
No way I know if to do it be selecting the whole table (with Conditional Formatting).
But it will work by selecting the whole row (like I said above)

NOTE: A1 in the above formulas would be the cell that has the 1 or 0 in it at the end of the data.
 
0 is not even or odd, by the way.

If the number is only going to be a 1 or a zero, and you want the format to be applied if it is a 1, that is actually much simpler.

Select the row.

In Conditional Formatting, us "Formula Is":
=IF($A$1,1,0)

A1 being the target cell with the 1 or the 0.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor