Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can I link the conditional formatting of one cell to the contents of another?

Hey,


I've seen a few postings on this question, and it seems as though that there hasn't been a simple solution offered as yet, so forgive me if I'm asking the same question again...


I'm trying to make it so that if there is data in one cell then a different cell will be affected by a conditional formatting rule. I'm not using the spreadsheet for accounting, but for scheduling, and I want to indicate that if a person assigned to a particular task has completed their task and indicates as such in the appropriate box, then another box on the spreadsheet will blank out (specifically the number of days until the deadline). It's purely aesthetic.


One solution I thought could work but doesn't (or at least I can't find a way to make it work) is to set it up by way of a date conditional formatting, in that if the due date has passed (ie the due date is before today) then the cell will change colour, but because the contents of the cell are is formatted as text and not a date it seems to ignore the conditional formatting.


As I said, it seems that I'm not alone in wanting to link the conditonal formatting of one cell to the contents of another, and wonder if by now this problem has been easily resolved? Any help would be greatly appreciated!


Incidentally, I'm also wanting to find a way to display the number of days left before a due date as a positive number, not a negative. Again, purely aesthetic. Is this possible?


Tim


Using Numbers V 3

Posted on Nov 27, 2013 2:53 PM

Reply
Question marked as Best reply

Posted on Nov 27, 2013 4:26 PM

HI Tim,


To your main question: No.


Conditional formatting rules compare the contents of the cell to be formatted to either fixed value or to the contents of a separate cell. If you can arrange to have those cells contain the same type of value, and arrange a means of maing the vlues equal or unequal using an IF statement, then either of the cells can use a conditional formatting rule that sets the format depending on the contents of the other with respect to its own value.


To your described case:


You have a cell (C3) in which task completion is marked by checking a checkbox.

You have a second cell (D3) that contains the due date for the task's completion.

You have a third cell (E3) which reports the number of days to the due date for that task.


C3 is manually entered by checking the checkbox.

D3 may be the result of a calculation, or may be entered from thekeyboard. The contents MUST be a Date and Time value.

E3 contains the formula below:


=IFERROR(IF(C3,"done",DATEDIF(D3,TODAY(),"D")),"overdue "&DATEDIF(TODAY(),D3,"D")&" days")


E3 may be conditionally formatted using rules such as:


Text begins with ov


Text begins with do


Regards,

Barry


NOTE: No time to test these, so some editing may be necessary.

B

3 replies
Question marked as Best reply

Nov 27, 2013 4:26 PM in response to timbarooni

HI Tim,


To your main question: No.


Conditional formatting rules compare the contents of the cell to be formatted to either fixed value or to the contents of a separate cell. If you can arrange to have those cells contain the same type of value, and arrange a means of maing the vlues equal or unequal using an IF statement, then either of the cells can use a conditional formatting rule that sets the format depending on the contents of the other with respect to its own value.


To your described case:


You have a cell (C3) in which task completion is marked by checking a checkbox.

You have a second cell (D3) that contains the due date for the task's completion.

You have a third cell (E3) which reports the number of days to the due date for that task.


C3 is manually entered by checking the checkbox.

D3 may be the result of a calculation, or may be entered from thekeyboard. The contents MUST be a Date and Time value.

E3 contains the formula below:


=IFERROR(IF(C3,"done",DATEDIF(D3,TODAY(),"D")),"overdue "&DATEDIF(TODAY(),D3,"D")&" days")


E3 may be conditionally formatted using rules such as:


Text begins with ov


Text begins with do


Regards,

Barry


NOTE: No time to test these, so some editing may be necessary.

B

Nov 27, 2013 9:47 PM in response to timbarooni

Hi Tim,


Here are some pictures in Numbers 3 that may help get you started. The formula in A1 is =TODAY().


if the due date has passed (ie the due date is before today) then the cell will change colour


This will do that:


User uploaded file



As Barry indicated, this will only work if the contents of the cells in C and A1 are Date & Time values.


I want to indicate that if a person assigned to a particular task has completed their task and indicates as such in the appropriate box, then another box on the spreadsheet will blank out (specifically the number of days until the deadline).


Here's one way to achieve that effect:

User uploaded file


The formula in D3 is =IF(B3,0,IFERROR(DATEDIF($A$1,C3,"D"),0)).


It inserts a zero if the checkbox in column B is checked (the IF does that) or if the date in Due is before Today (the IFERROR does that because DATEDIF expects the end-date to be after the start-date and will throw off an error if the reverse is true).


Then this Conditional Highlighting rule (I scrolled down and chose "Custom Style" initially out of sight at the bottom of the list and since I chose a font color of white it doesn't display in this screenshot as my format choice) will turn the font white if there is a zero in that cell:


User uploaded file


I resorted to DATEDIF because Durations in Conditional Highlighting are buggy and don't seem to work, whereas rules using Numbers do.


The end result is that the values in D (Days until due) will "disappear" if the Done checkbox is checked or if the due date is before today's date. You can change the logic and formatting as needed.


SG

Can I link the conditional formatting of one cell to the contents of another?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.