Can i make an exception to a formula

I have a spreadsheet to have a running balance for truck payments.

A1 'Beginning balance'

B1 'Payment'

C1 'Ending balance'


My formula in C1 is simply A1-B1

I then inserted in A2 "=C1" to carry the ending balance to the new beginning balance


The problem I'm having is its continuous so as soon as I enter the first beginning balance, every row

in columns A and C fill with the beginning balance amount. After entering a payment they all fill with the new ending balance. Is there a formula I can use to stop the remaining cells from filling until I enter a payment?

iMac 27″ 5K, macOS 11.5

Posted on Sep 18, 2021 10:17 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 20, 2021 4:15 PM

An "invalid reference" error usually means the formula is referencing a cell that does not exist, or (possibly) is referencing a cell containing a formula that references a cell tha does not exist.


Here'a a table resemblng what you've described, but with a header row (row 1) containing labels for the data in each column, and the actual data entries and calculation beginning in row 2.


The table contains two formulas, based on the two in your initial post, and the revisions shown in Badunit's post above. These are shown below the table image.



The first formula: IF(B2="","",A2-B2)

is entered as shown in C2, then filled down to the last row of column C.


The second formula: IF(B2="","",C2)

is entered in A3, then filled down to the end of column A.


In each, the core part of the formula is shown above in bold type. The core is wrapped in an IF statement that says "If cell B2 is empty or contains a null string ( "" ), place a null string in this cell. Otherwise, do the "if false" action (the part shown in bold).


Results after an entry in B2 are shown above, Results after two more payments have been entered (in B3 and B4) can be seen below.



Regards,

Barry

Similar questions

9 replies
Question marked as Top-ranking reply

Sep 20, 2021 4:15 PM in response to daibrahim64

An "invalid reference" error usually means the formula is referencing a cell that does not exist, or (possibly) is referencing a cell containing a formula that references a cell tha does not exist.


Here'a a table resemblng what you've described, but with a header row (row 1) containing labels for the data in each column, and the actual data entries and calculation beginning in row 2.


The table contains two formulas, based on the two in your initial post, and the revisions shown in Badunit's post above. These are shown below the table image.



The first formula: IF(B2="","",A2-B2)

is entered as shown in C2, then filled down to the last row of column C.


The second formula: IF(B2="","",C2)

is entered in A3, then filled down to the end of column A.


In each, the core part of the formula is shown above in bold type. The core is wrapped in an IF statement that says "If cell B2 is empty or contains a null string ( "" ), place a null string in this cell. Otherwise, do the "if false" action (the part shown in bold).


Results after an entry in B2 are shown above, Results after two more payments have been entered (in B3 and B4) can be seen below.



Regards,

Barry

Sep 20, 2021 10:46 PM in response to daibrahim64

The Help menu in Numbers is a good place to start.

This is from an older version than the one you are using, but the menu items may be the same. The highlighted menu item is an excellent introduction to formulas and the functions that can be used in their construction. The link, in my installed version of Numbers, is to a document that lists and discusses only the functions as of 2019. Yours may go to an updated document.


A second excellent resource is the Functions Browser, which opens whenever you select a cell and type =.

The browser lists all functions supported in Numbers, gives a description of the function, the syntax of a formula using the function, and at least one example of a formula constructed with that function, and an examply of where it might be used in a spreadsheet.


The core formulas used in my examples above are pretty basic ones. The only 'esoteric' part is the switch that keeps cells 'blank' until there is a result to calculate.


Badunit's version and mine do the same job—preventing the calculation until there is data entered in a cell needed to complete the calculation.


**:  Cell C1 =IF(B1<>"",A1-B1,"")     'if B1 is not 'empty', do this, otherwise, place a null string.'

Barry:            IF(B2="","",A2-B2)       'if B2 is 'empty', place a null string, otherwise, do this.'


I prefer 'my' version only because it lets me wrap the core formula with only the closing parenthesis following that core part.


Regards,

Barry

Sep 21, 2021 4:56 PM in response to Barry

   'if B1 is not 'empty', do this, otherwise, place a null string.'

   'if B2 is 'empty', place a null string, otherwise, do this.'


Thank you. That is exactly what I was trying to do. The 'problem' I was having was that I didn't know which symbols represent the 'not empty' and 'empty'., etc nor where to find that information. Numbers gives instructions but not detailed info on the symbols represented.

Sep 21, 2021 11:57 PM in response to daibrahim64

"I didn't know which symbols represent the 'not empty' and 'empty'."


A cell containing a null string (a text value with zero length) isn't really 'empty,' but IF will accept that value as the equivalent of 'empty.'


Any content that is placed between opening and closing double quotes in a formula is treated as text. A null string (also known as 'the empty string' ) is a special case. entered as a pair of double quotes with nothing between them. It's and easy thing to misread in the text here, but somewhat easier to spot and recognize in the formula editor images in my initial reply.


Regards,

Barry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can i make an exception to a formula

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.