How to use IF

J

JMM

Hi,

I'm about to get gray hair here!

My problem goes like this:

I have three variables x1, x2 and x3. When this valiue is shown in CELL A1 I
need for the value in B1 to return 1, 2 og 3 and if no information in A1 I
need to have FALSE in B1.

Can someone help?

Thanks!
J
 
B

Bob Phillips

=IF(A1="x1",1,IF(A1="x2",2,IF(A1="x3",3,IF(A1="",FALSE,""))))

You didn't say what to do if none of these so I left it blank.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

jmm

Hi Bob,

Thank you for your quick replay. The problem is that, this is exactly that I
wrote, but I still get the error... Is it because the value in A1 comes for
another sheet?

~J

"Bob Phillips" skrev:
 
B

Bob Phillips

aah! you didn't say that :)

If A1 is on another sheet, say "Data Sheet", then use

=IF('Data Sheet'!A1="x1",1,IF('Data Sheet'!A1="x2",2,IF('Data
Sheet'!A1="x3",3,IF('Data Sheet'!A1="",FALSE,""))))


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

JMM

Argh! It still makes the same error!
This is what I write (It's in Danish):
=HVIS(Ordrebekræftelse!B10=C58,B58,HVIS(Ordrebekræftelse!B10=C57,B57,HVIS(Ordrebekræftelse!B10=C56,B56,HVIS(Ordrebekræftelse!B10="",B59,""))))

Translated into English:
=IF(Ordre!B10=C58,B58,IF(Ordre!B10=C57,B57,IF(Ordre!B10=C56,B56,HVIS(Ordre!B10="",B59,""))))

Can you see any error?

~J




"Bob Phillips" skrev:
 
J

JulieD

Hi JMM

what sheet is the B58 (etc on)
let's say you are going to make the first condition equal true what is
actually in cell B10 (on the Order Sheet?)
is it
C58
or a number like 1 which is also in C58

Cheers
JulieD
 
A

Aladin Akyurek

JMM said:
Argh! It still makes the same error!
This is what I write (It's in Danish):
=HVIS(Ordrebekræftelse!B10=C58,B58,HVIS(Ordrebekræftelse!B10=C57,B57,HVIS(Ordrebekræftelse!B10=C56,B56,HVIS(Ordrebekræftelse!B10="",B59,""))))

Translated into English:
=IF(Ordre!B10=C58,B58,IF(Ordre!B10=C57,B57,IF(Ordre!B10=C56,B56,HVIS(Ordre!B10="",B59,""))))

Can you see any error?
[...]

Whenever you seem to need a chain of (nested) IFs, investigate the
possibility of invoking a lookup formula instead. For example:

=IF(Ordre!B10="",B59,INDEX(B56:B58,MATCH(Order!B10,C56:C58,0))
 
B

Bob Phillips

If it's in Dutch, change my commas to semi-colons

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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