Conditional Statement

R

regdor

I am working with a spreadsheet that uses the conditional statement as follows:
=IF(C7=9999,0,(+B7-A7)*24). The forumla works fine when B7 and A7 have data
in them, however when the formula references cells that don't contain any
data I get a #value error. How can i get the same results from the formula
and not get the error message. Thanks.
 
T

T. Valko

If you're getting a #VALUE! error when A7 and/or B7 "appear" to be empty
then those cells are not empty. If both cells were empty the result of the
formula would be 0.

Do those cells contain formulas that might return formula blanks?

=IF(C7=9999,0,IF(COUNT(A7:B7)=2,(B7-A7)*24,0))
 
R

regdor

thanks, it works now.

T. Valko said:
If you're getting a #VALUE! error when A7 and/or B7 "appear" to be empty
then those cells are not empty. If both cells were empty the result of the
formula would be 0.

Do those cells contain formulas that might return formula blanks?

=IF(C7=9999,0,IF(COUNT(A7:B7)=2,(B7-A7)*24,0))
 
R

regdor

Now I need to move the value of the calculation to a different cell upon the
reference cell (C7) equalling 9999. Any ideas on how to accomplish this.
Thanks
 
T

T. Valko

You need to enter a formula in the other cell. A formula can't "push" or
"move" data to a cell. A formula can only "pull" data into its own cell.

So, based on your previous formula I'm guessing you need something like
this:

=IF(C7=9999,0,"")
 
R

regdor

Thanks your insight pointed me in the right direction, I have one more
question. How would I get the formula to respond to multiple variable not
just 9999. I need the cell to perform the action when one of several numbers
are entered into c7. Thnaks
 
R

regdor

Nevermind, I figured it out. Your help with the first problems pointed me in
the right direction. Thanks Again!
 
T

T. Valko

You're welcome!

--
Biff
Microsoft Excel MVP


regdor said:
Nevermind, I figured it out. Your help with the first problems pointed me
in
the right direction. Thanks Again!
 

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