How to add sign to a cell based on data in another cell?

I would like to add sign to a Number cell based on whether the preceeding column contains the pop-up option 'Debit' or 'Credit'.


If 'Debit' is selected, the amount entered (number) should be converted to a negative number. If 'Credit' is selected, the number should remain as it is.



I know that in Numbers a cell can only be used to either store user-entered data or as a formula cell, i.e., it cannot do both.


So I created another column that will perform the formula for me while also copying the amount entered in the original 'Amount' cell. However, I don't think my solution is elegant.



I would like to know if there is a better way to do this, as I don't want to have two columns visible in my table.


Thanking you.

MacBook Air 13″, macOS 14.5

Posted on Jul 14, 2024 4:04 AM

Reply
2 replies

Jul 14, 2024 7:18 PM in response to Unequivocally-Unimportant

As far as the formula goes, nothing wrong with what you wrote but you don't need to use the PRODUCT function, a simple multiplication will do.


=IF(Transaction="Debit", -1*D2, D2)


Instead of this, though, how about changing the "Amount" column to "Credit", make a separate column next to it for "Debit" and enter the amounts in their respective columns (as positive numbers)? As an added bonus, you can get rid of the "Transaction" column because you know which it is from looking at which column the number is in.

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.

How to add sign to a cell based on data in another cell?

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