1

I hope you can help me on this issue.

I am currently using Excel 2007 and I am creating a dynamic Planning/Time Sheet for our Team. So far everything is going well.

Now unfortunately I am having an issue with the Conditional Format. I am formatting the Cells in order to graphically show the current Status of the Person working. I am using the Conditional Format with a Formula example: =OFFSET(DataStart17D;COLUMN();ROW()-49;1;1)="PM"

Now I am trying to applying 2 conditions with a gradient fill of 2 colors like example: =AND(IF(OFFSET(DataStart17D;COLUMN();ROW()-49;1;1)="PM";TRUE;FALSE);IF(OFFSET(DataStart17D;COLUMN();ROW()-52;1;1)="AM";TRUE;FALSE)

Problem is, as soon as I use the IF or the AND Statement no condition is applied at all. I have applied the above formula to the Cell itself and have received "TRUE" as the condition.

What is odd too is that if I apply =OFFSET(DataStart17D;COLUMN();ROW()-49;1;1)="PM" it works fine, if I use =IF(OFFSET(DataStart17D;COLUMN();ROW()-49;1;1)="PM";TRUE;FALSE) once again no condition applies.

I have searched the web for a Solution and could not find one yet :(

Would really be pleased if someone could help me on this one :)

Best Regards, Richard J. Dana

1 Answer 1

1

You don't need IF Statment and TRUEs and FALSEs withih a Conditional Formatting formula. By its nature the formula is conditional.

Try something like:

=AND(OFFSET(DataStart17D;COLUMN();ROW()-49;1;1)="PM";OFFSET(DataStart17D;COLUMN();ROW()-49;1;1)="AM")

Once you do so, you'll see an additional problem. The two statements in your AND function are mutually exclusive, so it will never evaluate to TRUE.

EDIT:

There does seem to be an issue with the AND statement and multiple OFFSET statements that use ROW or COLUMN

Please note that I'm going to use commas instead of semicolons as function parameter separators here, otherwise it's too hard to convert. You'll have to change the commas back to semicolons.

Also note that you didn't need the last two arguments in either the ROW or COLUMN function in your original question. You had them set to a height and width of 1, which is the default, and is optional.

Here's a simplified example:

If you do something like:

OFFSET(DataStart17D,ROW()+1,COLUMNS())="PM"

it will evaluate to TRUE in the worksheet and also in the conditional formatting

If you do something like:

=AND(OFFSET(DataStart17D,ROW()+1,COLUMNS())="PM",OFFSET(DataStart17D,ROW()+1,COLUMNS())="PM")

which is just repeating the same statement twice, it will evaluate to TRUE in the worksheet, but won't trigger the conditional format.

All of the above is just as you stated in your question. The answer that I think works is to use ROWS and COLUMNS instead, like this:

=AND(OFFSET(DataStart17D,ROWS($1:2)+1,COLUMNS($A:A))="PM",OFFSET(DataStart17D,ROWS($1:2)+1,COLUMNS($A:A))="AM")

The above would be the formula for A2. Note that the first row or column inside the parentheses is anchored with a dollar sign. This gives you the count of rows or columns from A1, effectively the same thing as the ROW or COLUMN function.

Sign up to request clarification or add additional context in comments.

5 Comments

Hi Doug thanks for the quick reply. I need to change the question, the second Offset is at "-52" position. Ive checked it unfortunately that did not solve the problem yet. I have as well checked the Condition. I have 6 Columns for every Dataset (Datastart01,Datastart02). For example Column A = Status, Column B = From Time, Column C = To Time, Column D = Status, Column E = From Time, Column F = To Time. If the Condition in A is F and in D is VM its fill is a gradient double color else it uses one color
I have tested on a different Worksheet. I have made a similar buildup, still no result is displayed. Is it perhaps possible that Excel 2007 is not able to combine both "OFFSET" & (Boolean) in a Conditional Format?
OK, I see what you are saying now. There does seem to be a bug, having to do with Column and Row though. I'll edit my answer with a possible solution.
Perfect :) Thanks a lot for the help. Didnt know such a glitch existed. Had to adapt the formula but it works perfectly now. Thanks a lot :)
I didn't know that either, so thanks for the good question! (I just remembered to +1 it.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.