IF formula query - Help!!

G

Guest

I am trying to set up a formula which will validate if cells (non consecutive
cells) contain a value or not (value could be figures/ dates or text). If any
of the 9 cells do not contain a value then I want a value of "error" to
appear. If they all contain a value then I want a value of "OK" to be
displayed. This is what I have got from the knowledge base but I cannot get
this to work and I know I might have difficulty with the 9 statements as I
understand the maximum is 7. This is the formula I have been using:

=IF(C2>0,"ok","Error",IF(D2>0,"ok","Error",IF(E2>0,"ok","Error",IF(F2>0,"ok","Error",IF(G2>0,"ok","Error",IF(K2>0,"ok","Error",IF(L2>0,"ok","Error",IF(O2>0,"ok","Error"))))))))

It works OK when the values returned after each statement are difference but
because I want an overall value of OK or Error (and each cell needs to be
validated on this basis) I think I am confusing it.

Can anyone help?

Thanks
 
B

Bob Phillips

=IF(OR(C2>0,D2>0,E2>0,F2>0,G2>0,K2>0,L2>0,O2>0),"ok","Error")

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
D

David Biddulph

The OP said that he wanted ALL the cells to have a value before displaying
OK.

Try
=IF(OR(C2="",D2="",E2="",F2="",G2="",K2="",L2="",O2=""),"Error","OK")
 
B

Bob Phillips

But his formula was definitely OR, and he seems happy. Sometimes you get
conflicting statements, so you take a punt. I took a punt.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
G

Guest

I am trying to set up a formula which will validate if cells (non consecutive
cells) contain a value or not (value could be figures/ dates or text). If any
of the 9 cells do not contain a value then I want a value of "error" to
appear. If they all contain a value then I want a value of "OK" to be
displayed. This is what I have got from the knowledge base but I cannot
get

"contain a value or not (value could be figures/ dates or text)"

lets hope that the figure needed to be placed in any cell is non-negative
and place as hard figures (no source refs.)

happy holiday
 

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