multiple sheets - IF statement?

  • Thread starter Thread starter Grace
  • Start date Start date
G

Grace

Hello, I have a spreadsheet that contains 5 sheets. I
would like to add a function that calculates the number of
pages only if a value exists in a field on a page. I
can't seem to use the IF statement because I actually need
an IF/ELSE statement. How can I do this.

My example is as follows:

On page 1: =IF('PAGE2'!R20<>0,"2","1") but if there is a
page 3 or 4 or 5, etc. that contains values, then how do I
use this IF statement?

Please let me know if you do not understand what I am
trying to ask.

Thank you very much,
Grace
 
What about the COUNTIF function - will it work for you?
If it is always the same cell (regardless of the page),
then:
=IF(COUNTIF('PAGE2'!R20:'PAGE5'!R20,"<>0")>1,"2","1")
(this checks to see if any of the cells on any of the
pages is non-zero - and makes the answer 2 if yes, 1 if
no. Not sure if that is what you want to do, but
hopefully you can see how it might be used).

The other alternative (like an IF-THEN-ELSE) is nested IFs:

=IF('PAGE2'!R20<>0,IF('PAGE3'!R20<>0,"3","2"),"1")
(So if the first condition is true, it evaluates the 2nd
IF function; if the first condition is false it gives the
result "1". This is more flexible than the suggestion
above but makes for a long, complicated function (esp.
after you add enough IFs to take care of all your pages)!!!

K Dales
 

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

Back
Top