PC Review


Reply
Thread Tools Rate Thread

Can AND and OR be on the same formula?

 
 
Jorge E. Jaramillo
Guest
Posts: n/a
 
      26th Nov 2009
Hi

I need to evaluate the conditions of two columns on a spreadsheet and for
that I use the AND function and it works well. Now a new condition that
overrrides the previous ones has arised so now I have to do both, the former
verification (AND function) and a new one to check for a new value in one of
the columns that is enough to classify the whole register as TRUE.

Is there a way I can mix AND and then OR functions in the same formula? I
guess there is but i haven't been able to find the propoer sintax to do it.

Thanks in advance

Jorge E Jaramillo
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      26th Nov 2009
Sure. Example.
=IF(AND(1=1,2=2),1,2)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Jorge E. Jaramillo" <(E-Mail Removed)> wrote in
message news:1CFEE737-EE6B-4D04-AA69-(E-Mail Removed)...
> Hi
>
> I need to evaluate the conditions of two columns on a spreadsheet and for
> that I use the AND function and it works well. Now a new condition that
> overrrides the previous ones has arised so now I have to do both, the
> former
> verification (AND function) and a new one to check for a new value in one
> of
> the columns that is enough to classify the whole register as TRUE.
>
> Is there a way I can mix AND and then OR functions in the same formula? I
> guess there is but i haven't been able to find the propoer sintax to do
> it.
>
> Thanks in advance
>
> Jorge E Jaramillo


 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      26th Nov 2009
The short answer is yes you can use both and and or. Post your existing
formula along with a bit of sample data. Let us know what new logic needs to
be implimented and we can give you a hand.
--
HTH...

Jim Thomlinson


"Jorge E. Jaramillo" wrote:

> Hi
>
> I need to evaluate the conditions of two columns on a spreadsheet and for
> that I use the AND function and it works well. Now a new condition that
> overrrides the previous ones has arised so now I have to do both, the former
> verification (AND function) and a new one to check for a new value in one of
> the columns that is enough to classify the whole register as TRUE.
>
> Is there a way I can mix AND and then OR functions in the same formula? I
> guess there is but i haven't been able to find the propoer sintax to do it.
>
> Thanks in advance
>
> Jorge E Jaramillo

 
Reply With Quote
 
JoeU2004
Guest
Posts: n/a
 
      26th Nov 2009
"Jorge E. Jaramillo" <(E-Mail Removed)> wrote:
> Is there a way I can mix AND and then OR functions in the same formula?


Sure.

> i haven't been able to find the propoer sintax to do it.


Since you neglected to post your formula (klunk!) and most of us are not
clairvoyant, we cannot show you the proper syntax either.

But perhaps the following will help you.

If you currently have:

=IF(AND(A1=1,B1=2), C1, D1)

change that to:

=IF(OR(E1=3,AND(A1=1,B1=2)), C1, D1)

A note on "overriding" conditions: normally, all function parameters are
evaluated before evaluating the function. (Noted exception: IF function.)
So it might be necessary to split "or" tests into two IF parameters. For
example:

=IF(E1=3, C1, IF(AND(A1=1,B1=2), C1, D1))

The devil is in the details. If you need further assistance, you will need
to post those details.


----- original message -----

"Jorge E. Jaramillo" <(E-Mail Removed)> wrote in
message news:1CFEE737-EE6B-4D04-AA69-(E-Mail Removed)...
> Hi
>
> I need to evaluate the conditions of two columns on a spreadsheet and for
> that I use the AND function and it works well. Now a new condition that
> overrrides the previous ones has arised so now I have to do both, the
> former
> verification (AND function) and a new one to check for a new value in one
> of
> the columns that is enough to classify the whole register as TRUE.
>
> Is there a way I can mix AND and then OR functions in the same formula? I
> guess there is but i haven't been able to find the propoer sintax to do
> it.
>
> Thanks in advance
>
> Jorge E Jaramillo


 
Reply With Quote
 
Jorge E. Jaramillo
Guest
Posts: n/a
 
      26th Nov 2009
Hi People thanks for your quick answer and sorry for not having posted my
data I thought I was being clear enough but certainly I was not. So here's my
example. Say I have in columns A and B the following data

Animal Color
Horse Blue
Fish Green
Dog Green
Rabbit Red
Parrot Purple
Rabbit Blue
Hare Magenta

And I need to make a validation of all and only the Rabbits that are blue,
so I use the formula in column C: =AND(A2="Rabbit",B2="Blue") which works
well. The new condition is that when there is a Hare in the Animal colum it
needs to be validated as if it were a Blue Rabbit despite the color this hare
is (and that it is not a rabbit). So where do I need to add A2="Hare" to the
formula to make it work?
Thanks

Jorge E Jaramillo
"Jorge E. Jaramillo" wrote:

> Hi
>
> I need to evaluate the conditions of two columns on a spreadsheet and for
> that I use the AND function and it works well. Now a new condition that
> overrrides the previous ones has arised so now I have to do both, the former
> verification (AND function) and a new one to check for a new value in one of
> the columns that is enough to classify the whole register as TRUE.
>
> Is there a way I can mix AND and then OR functions in the same formula? I
> guess there is but i haven't been able to find the propoer sintax to do it.
>
> Thanks in advance
>
> Jorge E Jaramillo

 
Reply With Quote
 
JoeU2004
Guest
Posts: n/a
 
      26th Nov 2009
"Jorge E. Jaramillo" <(E-Mail Removed)> wrote:
> so I use the formula in column C: =AND(A2="Rabbit",B2="Blue")
> [....]
> The new condition is that when there is a Hare in the Animal colum it
> needs to be validated as if it were a Blue Rabbit despite the color this
> hare is


=OR(A2="hare", AND(A2="rabbit",B2="blue"))


----- original message -----

"Jorge E. Jaramillo" <(E-Mail Removed)> wrote in
message news:EB67D4FF-1C18-47FF-9C5F-(E-Mail Removed)...
> Hi People thanks for your quick answer and sorry for not having posted my
> data I thought I was being clear enough but certainly I was not. So here's
> my
> example. Say I have in columns A and B the following data
>
> Animal Color
> Horse Blue
> Fish Green
> Dog Green
> Rabbit Red
> Parrot Purple
> Rabbit Blue
> Hare Magenta
>
> And I need to make a validation of all and only the Rabbits that are blue,
> so I use the formula in column C: =AND(A2="Rabbit",B2="Blue") which works
> well. The new condition is that when there is a Hare in the Animal colum
> it
> needs to be validated as if it were a Blue Rabbit despite the color this
> hare
> is (and that it is not a rabbit). So where do I need to add A2="Hare" to
> the
> formula to make it work?
> Thanks
>
> Jorge E Jaramillo
> "Jorge E. Jaramillo" wrote:
>
>> Hi
>>
>> I need to evaluate the conditions of two columns on a spreadsheet and for
>> that I use the AND function and it works well. Now a new condition that
>> overrrides the previous ones has arised so now I have to do both, the
>> former
>> verification (AND function) and a new one to check for a new value in one
>> of
>> the columns that is enough to classify the whole register as TRUE.
>>
>> Is there a way I can mix AND and then OR functions in the same formula? I
>> guess there is but i haven't been able to find the propoer sintax to do
>> it.
>>
>> Thanks in advance
>>
>> Jorge E Jaramillo


 
Reply With Quote
 
Jorge E. Jaramillo
Guest
Posts: n/a
 
      26th Nov 2009
Awesome!

Thanks a lot (I clicked on Yes at the question regarding the usefulness of
your answer)

"JoeU2004" wrote:

> "Jorge E. Jaramillo" <(E-Mail Removed)> wrote:
> > so I use the formula in column C: =AND(A2="Rabbit",B2="Blue")
> > [....]
> > The new condition is that when there is a Hare in the Animal colum it
> > needs to be validated as if it were a Blue Rabbit despite the color this
> > hare is

>
> =OR(A2="hare", AND(A2="rabbit",B2="blue"))
>
>
> ----- original message -----
>
> "Jorge E. Jaramillo" <(E-Mail Removed)> wrote in
> message news:EB67D4FF-1C18-47FF-9C5F-(E-Mail Removed)...
> > Hi People thanks for your quick answer and sorry for not having posted my
> > data I thought I was being clear enough but certainly I was not. So here's
> > my
> > example. Say I have in columns A and B the following data
> >
> > Animal Color
> > Horse Blue
> > Fish Green
> > Dog Green
> > Rabbit Red
> > Parrot Purple
> > Rabbit Blue
> > Hare Magenta
> >
> > And I need to make a validation of all and only the Rabbits that are blue,
> > so I use the formula in column C: =AND(A2="Rabbit",B2="Blue") which works
> > well. The new condition is that when there is a Hare in the Animal colum
> > it
> > needs to be validated as if it were a Blue Rabbit despite the color this
> > hare
> > is (and that it is not a rabbit). So where do I need to add A2="Hare" to
> > the
> > formula to make it work?
> > Thanks
> >
> > Jorge E Jaramillo
> > "Jorge E. Jaramillo" wrote:
> >
> >> Hi
> >>
> >> I need to evaluate the conditions of two columns on a spreadsheet and for
> >> that I use the AND function and it works well. Now a new condition that
> >> overrrides the previous ones has arised so now I have to do both, the
> >> former
> >> verification (AND function) and a new one to check for a new value in one
> >> of
> >> the columns that is enough to classify the whole register as TRUE.
> >>
> >> Is there a way I can mix AND and then OR functions in the same formula? I
> >> guess there is but i haven't been able to find the propoer sintax to do
> >> it.
> >>
> >> Thanks in advance
> >>
> >> Jorge E Jaramillo

>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ Microsoft Excel Worksheet Functions 2 2nd Jun 2010 03:45 PM
Formula in Excel 07 to get the formula used in one cell in anothercell, showing VALUES, not cells references TobiasAL Microsoft Excel Discussion 2 1st Nov 2009 10:09 AM
Formula in Excel 07 to get the formula used in one cell in anothercell, showing VALUES, not cells references TobiasAL Microsoft Excel Worksheet Functions 1 29th Oct 2009 12:08 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro DavidGMullins@gmail.com Microsoft Excel Programming 1 20th Jul 2006 07:58 PM
Commenting custom formula fields/formula on formula editor Muxer Microsoft Excel Programming 2 24th Jul 2003 01:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:19 PM.