if statement

  • Thread starter Thread starter RichardO
  • Start date Start date
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
 
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
 
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)))
 
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)))
 
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
 
Hi Richard

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

thanks
JulieD
 
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.
 
Back
Top