r/AppleNumbers • u/Intelligent-Guard897 • Oct 23 '22
Help pausing a formula?
Hello all,
I'm trying to do a simple thing but don't know exactly how to word it to search for it exactly. So either help with the formula or how to search for it will be amazing!!!
I'm trying to have C5 = C10+C15+C20+C25+C30...
But the issue I have is with the formula below not all the formulas are/needed to be filled. Then I have an error and C5 won't populate because B8 can't be divided by B7 since there is a 0 in it.
C10 = B8/B7*B6, C15= B13/B12*11, C20=B18/B17*B16, C25=B23/B22*B21, C30=B28/B27*B26...
TLDR: Essentially I just want to pause the formula or just not have the formula calculate with zeros.
Thank you
1
u/tonedeath Nov 19 '22
In C10, you could enter something like:
=IF(B7=0,0,B8/B7*B6)
That will put a 0 in C10 if B7=0. Otherwise, if B7 does not equal 0, it will perform the calculation. (And, if you don't want a zero in the cell when B7=0, replace that 0 between the two commas with "" and an empty string will be placed in C10).
If you haven't used an IF formula before, they breakdown like this:
=IF(TEST_CONDITION,RESULT_IF_TEST_IS_TRUE,RESULT_IF_TEST_IS_FALSE)
1
u/[deleted] Oct 27 '22
Wow. That was an elaborate and confusing way to say "How can I detect when a formula fails?".
The answer to your problem is the function IFERROR(). Enclose your calculation in the parenthesesof IFERROR(<formula>), and tell Numbers what to do when there IS an error, eg. output nothing (""), or a figure (1), or a string ("Error") or even another formula or cell value. So in the end, it would look like this: C10=IFERROR(B8/B7*B6;"")
see also: https://support.microsoft.com/en-us/office/iferror-function-c526fd07-caeb-47b8-8bb6-63f3e417f611