ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   how do I write a formula for If And statements ex. if = to ? and (https://www.excelbanter.com/new-users-excel/123189-how-do-i-write-formula-if-statements-ex-if-%3D.html)

MacroLearning

how do I write a formula for If And statements ex. if = to ? and
 
Example if column="red" or column="green","white" otherwise "blue"?

I use If, And but do not get a value. Any help?

=if(AND A1="Red",A1="Green","White","Blue")

Nick Hodge

how do I write a formula for If And statements ex. if = to ? and
 
MacroLearning

if(AND(A1="Red",A1="Green"),"White","Blue")

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"MacroLearning" wrote in message
...
Example if column="red" or column="green","white" otherwise "blue"?

I use If, And but do not get a value. Any help?

=if(AND A1="Red",A1="Green","White","Blue")



CLR

how do I write a formula for If And statements ex. if = to ? and
 
Perhaps this......

IF(OR(A1="Red",A1="Green"),"White","Blue")

Vaya con Dios,
Chuck, CABGx3



"MacroLearning" wrote:

Example if column="red" or column="green","white" otherwise "blue"?

I use If, And but do not get a value. Any help?

=if(AND A1="Red",A1="Green","White","Blue")


Nick Hodge

how do I write a formula for If And statements ex. if = to ? and
 
Looked past the obvious, just spotted the missing braces. They still apply
but use OR rather than AND if you only want to match either rather than both

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"CLR" wrote in message
...
Perhaps this......

IF(OR(A1="Red",A1="Green"),"White","Blue")

Vaya con Dios,
Chuck, CABGx3



"MacroLearning" wrote:

Example if column="red" or column="green","white" otherwise "blue"?

I use If, And but do not get a value. Any help?

=if(AND A1="Red",A1="Green","White","Blue")



MacroLearning

how do I write a formula for If And statements ex. if = to ? a
 
It seems that it's only reading the last value "blue" not the first -
therefore making them all blue.


"Nick Hodge" wrote:

MacroLearning

if(AND(A1="Red",A1="Green"),"White","Blue")

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"MacroLearning" wrote in message
...
Example if column="red" or column="green","white" otherwise "blue"?

I use If, And but do not get a value. Any help?

=if(AND A1="Red",A1="Green","White","Blue")



Nick Hodge

how do I write a formula for If And statements ex. if = to ? a
 
Try not to break the threads, I posted in the original...should have been OR
not AND

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"MacroLearning" wrote in message
...
It seems that it's only reading the last value "blue" not the first -
therefore making them all blue.


"Nick Hodge" wrote:

MacroLearning

if(AND(A1="Red",A1="Green"),"White","Blue")

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"MacroLearning" wrote in
message
...
Example if column="red" or column="green","white" otherwise "blue"?

I use If, And but do not get a value. Any help?

=if(AND A1="Red",A1="Green","White","Blue")




Dave Peterson

how do I write a formula for If And statements ex. if = to ? and
 
If there's a chance you have to check more values in A1, you may find this
easier to type:

=IF(OR(A1={"Red","Green"}),"White","Blue")

Just keep adding more "colors" inside those {}'s.



MacroLearning wrote:

Example if column="red" or column="green","white" otherwise "blue"?

I use If, And but do not get a value. Any help?

=if(AND A1="Red",A1="Green","White","Blue")


--

Dave Peterson


All times are GMT +1. The time now is 10:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com