if statement

R

RichardO

Hello Everyone:

I have an if statement problem.

I have 3 columns. I want to say if A1 is blank it should return, B1
if B1 is blank, it should return c1, if c1 is blank, it should retur
A1. But I am getting a "0" even when A1 is not blank.

Thanks for your help.


RichardO
 
J

JulieD

Hi Richard

is only one of the three columns ever blank?

if so, this should give you what you want:

=IF(ISBLANK(A6),B6,IF(ISBLANK(B6),C6,IF(ISBLANK(C6),A6)))

Cheers
JulieD
 
B

Bob Phillips

or even

=IF(A1="",IF(B1<>"",B1,IF(C1="",A1,C1)),A1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Frank Kabel said:
Hi
try
=IF(A1="",IF(B1<>"",B1,IF(C1="",A1,C1)))
 
B

Bob Phillips

or my version as

=IF(A2="",IF(B2="",IF(C2="","",C2),B2),A2)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Frank Kabel said:
Hi
try
=IF(A1="",IF(B1<>"",B1,IF(C1="",A1,C1)))
 
R

RichardO

I tried both formulas you suggested and I am getting a FALSE for thi
formula
=IF(D5="",IF(F5<>"",F5,IF(H5="",D5,H5)))
and a 0 for this formul
=IF(ISBLANK(D5),F5,IF(ISBLANK(F5),H5,IF(ISBLANK(H5),D5)))

Do you have any idea what I am doing wrong? Thank you.


RichardO
 
R

RichardO

Hello:


I just tried Bob's formula and it worked. Thank you very much.


RichardO
 
J

JulieD

Hi Richard

could you type out your data in column D5, H5 & F5 in a return post

thanks
JulieD
 
H

Harlan Grove

or even

=IF(A1="",IF(B1<>"",B1,IF(C1="",A1,C1)),A1) ...

OP's specs are circular. If A, B and C are blank, probably should return a
blank. The formula above could be simplified to

=IF(A1<>"",A1,IF(B1<>"",B1,C1))

since the evaluation precedence in Bob's formula is A highest, B next, C lowest.
 

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