# Thread: Using IF Statements with mutliple sheets

1. Registered User
Join Date
Mar 2004
Posts
68

## Unanswered: Using IF Statements with mutliple sheets

Hello, I have a spreadsheet that contains 5 sheets. I labled these each as a "Page" for the user. I would like to add a function that calculates the number of pages only if a value exists in a field on that 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

2. Registered User
Join Date
Oct 2003
Posts
1,091
Howdy, Grace.
Originally Posted by palto1
Hello, I have a spreadsheet that contains 5 sheets. I labled these each as a "Page" for the user. I would like to add a function that calculates the number of pages only if a value exists in a field on that 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?
It depends on what you want to achieve; you can use a combination of IF and AND/OR statements, or nested IF. Let's take your example

=IF(AND('PAGE2'!R20<>0,'PAGE3'!R20<>0,'PAGE4'!R20< >0,'PAGE5'!R20<>0),"2","1")

The above says that if all four cells are empty on those pages, then put 2, otherwise 1.

=IF(OR('PAGE2'!R20<>0,'PAGE3'!R20<>0,'PAGE4'!R20<> 0,'PAGE5'!R20<>0),"2","1")

The above says that if any of the cells are empty, then put 2, otherwise 1/

And if that doesn't work, we can use nested IF statements.
=IF('PAGE2'!R20<>0,"2","1")

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•