Howdy, Grace.
Quote:
|
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")