Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Conditional Formatting with Excel - Part 6

Posted on 2011-03-13
16
Medium Priority
?
237 Views
Last Modified: 2012-05-11
Hi Experts,

Hopefully, I'll be done with conditional formatting after this request.

I've trying to conditionally format cells A2 through to A200 to highlight when a certain condition occurs(please see attached). Unfortunately, there is an error in my formulas.

I've tried both of the following:

=AND(F2<C2,J2<G2,G2<C2,J2<F2,G2>F2,N2<K2,K2<G2,N2<J2,K2>J2,R2>O2,(R2-O2>(P2-R2),(O2-Q2)>(R2-O2)*1.5),V2>S2,V2>R2,S2>O2,S2>K2)

=AND(F2<C2),(J2<G2,G2<C2,J2<F2,G2>F2),(N2<K2,K2<G2,N2<J2,K2>J2),(R2>O2,(R2-O2)>(P2-R2),(O2-Q2)>(R2-O2)*1.5),(V2>S2,V2>R2,S2>O2,S2>K2)

But I keep on getting error message with my formula.

I wonder if an expert could take a look and let me know where I might be going wrong

Cheers

Carlotn
Hammerv2.xlsm
0
Comment
Question by:cpatte7372
16 Comments
 
LVL 24

Expert Comment

by:StephenJR
ID: 35121698
Do these do the right thing? You had some missing (as well as superfluous) brackets.

=AND(F2<C2,J2<G2,G2<C2,J2<F2,G2>F2,N2<K2,K2<G2,N2<J2,K2>J2,R2>O2,(R2-O2)>(P2-R2),((O2-Q2)>(R2-O2)*1.5),V2>S2,V2>R2,S2>O2,S2>K2)

=AND(F2<C2,J2<G2,G2<C2,J2<F2,G2>F2,N2<K2,K2<G2,N2<J2,K2>J2,R2>O2,(R2-O2)>(P2-R2),((O2-Q2)>(R2-O2)*1.5),V2>S2,V2>R2,S2>O2,S2>K2)
0
 

Author Comment

by:cpatte7372
ID: 35121726
Stephen,

Thanks for responding, I'm going to check it now...
0
 

Author Comment

by:cpatte7372
ID: 35121788
Stephen,

Unfortunately it doesn't work.

I appreciate that my formula is probably incorrect. However, what I'm trying to do with this formula is calculate each bracketed area seperately. Does that make sense?

=AND(F2<C2),(J2<G2,G2<C2,J2<F2,G2>F2),(N2<K2,K2<G2,N2<J2,K2>J2),((R2>O2,(R2-O2)>(P2-R2),(O2-Q2)>(R2-O2)*1.5)),(V2>S2,V2>R2,S2>O2,S2>K2)


Cheers
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:StephenJR
ID: 35121797
I don't that brackets will make any difference with AND. I think

AND(1>2,(2>3,3>4))

is the same as

AND(1>2,2>3,3>4)

because as soon as single statement is False the whole statement will evaluate to False.

Perhaps you need OR? Can you explain what you are trying to do?
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35121844
What do you mean "calculate each bracketed area separately"?

Within an AND function every condition needs to be TRUE for the whole thing to be TRUE, so if you have

=AND(A1>B1,D1>E1,X1>Y1)

that means that the result is only TRUE if each of the 3 conditions is TRUE

regards, barry

0
 

Author Comment

by:cpatte7372
ID: 35121938
OK,

Give me second I will show what your formula produces....
0
 

Author Comment

by:cpatte7372
ID: 35121995
Ok,

One of the conditions is that the value in cell J should be lower than the cell value in cell G. However if you look at cell J151, its higher than cell G151, yet I get a positive condition a highlighted in cell A151.


Hammerv3.xlsm
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 35122025
I think the CF is coming from your other condition.
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 35122046
I'm guessing that may be a mistake as it only seems to apply to row 151 alone.
0
 

Author Comment

by:cpatte7372
ID: 35122110
Stephen,

I think you might be right. I need to run the conditional on different numbers. I'm going to check it out on different data now.

In meantime, can you see any reason why this formula doesn't work?

=AND(H2<D2,L2<H2,R2>O2,(R2>O2,(R2-O2)>(P2-R2),(O2-Q2)>(R2-O2)*1.5)

Cheers
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 35122141
Not sure, what you mean by not work? Not produce the expected result or produce an error?

As we were saying above, this could be simplified to:

=AND(H2<D2,L2<H2,R2>O2,(R2-O2)>(P2-R2),(O2-Q2)>(R2-O2)*1.5)
0
 

Author Comment

by:cpatte7372
ID: 35122153
Stephen

I meant to say can you see any reason why the following formula won't work:

=AND(H2<D2,L2<H2,(R2>O2,(R2-O2)>(P2-R2),(O2-Q2)>(R2-O2)*1.5)

Cheers
0
 
LVL 24

Accepted Solution

by:
StephenJR earned 2000 total points
ID: 35122168
Try this, one too many left brackets:

=AND(H2<D2,L2<H2,R2>O2,(R2-O2)>(P2-R2),(O2-Q2)>(R2-O2)*1.5)
0
 

Author Comment

by:cpatte7372
ID: 35122804
Stephen,

That worked. Cheers mate.
0
 
LVL 24

Expert Comment

by:Tracy
ID: 35357011
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question