Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -----Original Message----- 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using IF statement with sheets | Charts and Charting in Excel | |||
How to update data from multiple sheets to one specific sheets | Excel Discussion (Misc queries) | |||
If statement with vlookup link to multiple sheets | Excel Discussion (Misc queries) | |||
With statement on many sheets | Excel Discussion (Misc queries) | |||
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA | Excel Worksheet Functions |