if condition

C

Christopher Naveen

Hi,

I am trying with if condition but it returns some error. Pls refer the below
formula.

A B C D
ABC XYZ
DEF DEF

I am entering the formula in D1
=if(A1="ABC",B1="XYZ",A1)

Can anyone help me with the above formula.

Thanks in advance!

Chr.
 
M

Mike H

Hi,

I'm not entirely sure what you are trying to do but does this help?

=IF(AND(A1="abc",B1="xyz"),"Do this is true","Do this is false")

Mike
 
C

Christopher Naveen

Hi,

Let me explain u in words. if cell A1 is "ABC" then overwrite the cell b1 as
"XYZ" (cell B1 may contain some value, I need to overwrite it as "XYZ") and
if the condition is false then take the value of A1. (Formula I entered in
D1).

I hope now u can understand my requirement.

-Chr
 
C

Christopher Naveen

Hi,

Let me explain u in words. if cell A1 is "ABC" then overwrite the cell b1 as
"XYZ" (cell B1 may contain some value, I need to overwrite it as "XYZ") and
if the condition is false then take the value of A1. (Formula I entered in
D1).

I hope now u can understand my requirement.

Sorry for the inconvinience.

-Chr
 
C

Christopher Naveen

Hi,

Let me explain u in words. if cell A1 is "ABC" then overwrite the cell b1 as
"XYZ" (cell B1 may contain some value, I need to overwrite it as "XYZ") and
if the condition is false then take the value of A1. (Formula I entered in
D1).

I hope now u can understand my requirement.

Sorry for the inconvinience.

-Chr
 
N

NPell

Hi,

Let me explain u in words. if cell A1 is "ABC" then overwrite the cell b1 as
"XYZ" (cell B1 may contain some value, I need to overwrite it as "XYZ") and
if the condition is false then take the value of A1. (Formula I entered in
D1).

I hope now u can understand my requirement.

-Chr





- Show quoted text -

How I am understanding this is.
Condition a) A1 = "ABC"
Condition b) B1 = "XYZ"
If both Condition's are TRUE, then D1 needs to equal the contents of
A1.

If this is correct, then you need IF plus the AND function..
=IF(AND(A1="ABC",B1="XYZ"),A1," ")
 
P

Pete_UK

You cannot have both a value and a formula in B1, and a formula cannot
be used to "push" a value to another cell - it can only return a value
to the cell it is in. That being said, you can't have a formula in D1
affecting the contents of B1, so you'll have to re-think what you are
trying to achieve.

Hope this helps.

Pete
 
C

Christopher Naveen

Hi,

No. you didnt understand my requirement.

only one condition.

if A1 = "ABC" (if it is true) then overwrite the cell B1 as "XYZ", if th
condition is false then take the value of a1 into d1 (I entered the formula
in D1)

=if(A1="ABC",B1="XYZ",A1)

if the condition is true then overwrite the value "XYZ" in cell B1

-Chr
 
N

NPell

Hi,

No. you didnt understand my requirement.

only one condition.

if A1 = "ABC" (if it is true) then overwrite the cell B1 as "XYZ", if th
condition is false then take the value of a1 into d1 (I entered the formula
in D1)

=if(A1="ABC",B1="XYZ",A1)

if the condition is true then overwrite the value "XYZ" in cell B1

-Chr







- Show quoted text -

in B1 put .. =IF(A1="ABC","XYZ","")
in D1 put.. =IF(A1<>"ABC",A1," ")
 
M

Max

if A1 = "ABC" (if it is true) then overwrite the cell B1 as "XYZ", if th
condition is false then take the value of a1 into d1 (I entered the
formula in D1)

Just a comment .. what you want to happen in B1 is simply not possible by
virtue of a formula that you place in D1. A formula can only return values
in the cell that it is placed, it cannot affect other cells.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top