You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Blank cell formula

I have a spreadsheet and have activated the function Alternate row colour.

problem is when you have a zero value you can do conditional formatting, and it changes the text to the same colour as the spreadsheet.

with alternate row colour the zero value shows up on every second line.


what is the blank cell formula for numbers like in ms excel


example:

cell B2, C2, D2,E2 would be cells that manual input is put in it fuel cost car valets etc.

and in cell G2 the value of B2,C2,D2,E2 are added and results are shown in cell G2 using Sum.

if there is no values and cell G2 is a zero value.


what would the formula be if G2 is £0.00 to be blank. (Without using conditional formatting)


thanks if anyone can help (using iPad)

Posted on Sep 5, 2020 12:36 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 5, 2020 4:46 AM

If you don't want to use conditional formatting (which would be good choice) then you can do something like this:


=IF(SUM(B2:E2)=0,"",SUM(B2:E2))


If your region uses , as a decimal separator the formula would be:


=IF(SUM(B2:E2)=0;"";SUM(B2:E2))


SG

15 replies

Sep 5, 2020 5:30 AM in response to tradeimporters

If you want to use conditional formatting, make a different custom format than that. You can to set the opacity of the text to zero, which makes it disappear regardless of background color. In the screenshot below I clicked on the little color wheel where you pick the text color. The color wheel window pops up and you can drag the opacity slider to zero. The table has zeros in column B but you cannot see any of them.


Sep 8, 2020 9:53 PM in response to SGIII

Hi 


Thank you for your last formula, that really helped.


I am now faced with another issue with this same spreadsheet.


I can email the spreadsheet over if that would help.


I have a spreadsheet that tracks expenses and sales.

The formulas are designed to give a blank when there is no value.


Cell B2 to E2 are added up and result is in cell F2 for expenses.


Cell F2 uses this formula: IF(SUM(B2:E2)=0,"",SUM(B2:E2))


For sales


Cell H2 + cells K2 + L2 and result the result is in M2


Formula in Cell M2 is


IF(SUM(Hampden CashWork 'Wed, 1 Apr 2020',K2:L2)=0,"",SUM(Hampden CashWork 'Wed, 1 Apr 2020',K2:L2))


( I don’t know why the formula is not as simple as the one above, but still works.)


When I try to subtract Cell M2 - F2 it will give the result in N2


and if there is no result it should be blank.


Issues is when one of the cells are blank in M2 or F2 there is an error valve.


My formula in cell N2 which is wrong, can you help with this.


IF(SUM(Total Income 'Wed, 1 Apr 2020',−'Expenses Total ' 'Wed, 1 Apr 2020')=0,"",SUM(Total Income 'Wed, 1 Apr 2020',−'Expenses Total ' 'Wed, 1 Apr 2020'))


Pics below








Sep 8, 2020 11:27 PM in response to tradeimporters

The reason the formulas are longer is because you have "use header names as labels" turned on in Numbers/Preferences. I find it makes the formulas harder to read so I never use that feature.


The reason your formula fails is the negative signs. Your formulas for F2 and M2 result in either a number or a null string. The double quotes with nothing between them creates a null string which is a string with no characters in it. You can take a negative of a number but you cannot take a negative of a string, not even of a null string. Your formula is trying to take a negative of cell F2 but F2 is a null string.


Personally, I think your earlier solution of hiding the zeros might be the better idea than these formulas that are much more complicated than necessary. Forget about checking for zero and setting to a null string if it is, just do the proper math and if it is zero it will be zero. I think I would hide the zeros with a custom format, not a conditional format. Instead of setting the opacity to zero when the result is zero, create a custom format that shows nothing when the result is zero. Choose "create custom format" as the data format for the cell. Add a rule that shows nothing when equal to zero. Edit the other rule to show what you want to see otherwise. Give it a descriptive name. You can use that new format for all the other cells that need it. If you edit it later for some reason, the edits will apply to all cells which use it. Below is an example for currency. I am doing this on a Mac, not an iPad.








Sep 10, 2020 1:13 PM in response to Badunit

Hi badunit


Thank you for all your help, it’s really helped.


You are right, I have dug a deep hole. Lol

i should have just started with conditional format or custom.

but this is the last bit that I need to work or it will be back to the drawing board.


i tried the formula

=IF(SUM(M2-SUM(F2,0))=0,"",SUM(M2-F2))


problem is when one of the field’s are blank it gives back an error message.

when both fields are blank it’s fine or when both fields have values.

is there to be an or function?


Sep 9, 2020 8:13 PM in response to tradeimporters

It is my opinion you are digging the hole deeper. But, to answer your question, replacing the first

-'Expenses Total ' 'Wed, 1 Apr 2020'

with

-SUM('Expenses Total ' 'Wed, 1 Apr 2020', 0)

should make it work. I don't think the second one requires it.


You can see how much this is complicating your formulas. The method you are using is appropriate for a lot of things but, in my opinion, not for what you are doing. You need three SUMS and an IF where you should have a single SUM. Instead of =SUM(M2-F2) you have =IF(SUM(M2-SUM(F2,0))=0,"",SUM(M2-F2)). That is so much more complicated, harder to read, and harder to debug to uncover a mistake.


Also, you would not need to use SUM at all if the cells you are adding or subtracting are actual numbers, not null strings. A simple + or - will do the job if the cells are not strings.

=M2-F2 is the same as =SUM(M2,-F2)

It is simpler, shorter, and quicker to type.

Blank cell formula

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