Leave other cells blank if no data in cell.

Oryan77

Board Regular
Joined
May 9, 2009
Messages
176
Hi, I have 2 similar question.

I'm using a formula that I got from a previously made excel sheet. The formula does what I need it to do and looks like this:
=INT((D10-10)/2)

The problem is, if I don't enter a number in the cell D10, all the cells with this formula show -5.

If I don't want data entered into D10 yet, I'd like all the cells with that formula to be blank until I actually enter a number in D10.

I think it has to do with using an IF statement followed with ""? Am I on the right track?

Also, if I have other formulas like =SUM(AP3:AQ6), but the cells it refers to are blank, how can I make the cell with the formula also be blank rather than show a 0?

I know I can turn off the "Show a zero in cells that have zero value" option, but I was wondering how to do it with the formula instead.

Thanks!
 
do you mean enter k20? That is the cell i'm trying to add the formula to. When i change the formula in k20 to =isnumber(y20) i get true.

I didn't think this would matter, but i will mention it anyway...

Looks like...

=IF(N(Y20),SUM(Y20,AA20,AC20,AE20,AG20),"")
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Been reading this thread with interest,

Scottylad2

Are you saying that when a cell has a formula in (as this thread has in Y20) it you would need to use =0 instead of ""
Don
 
Upvote 0
Aladins formula does the same, as in lots of cases in Excel there's more than one way to skin a rabbit. There was no possibility of a negative number as was mentioned earlier so 0 was ok to go with
 
Upvote 0
so your saying use 0 instead of "" in the formula due to the cell having a formula in it and set options to not show 0's

Would this apply in all cases or just this one?

Thanks for the info

Don
 
Upvote 0
Excel Workbook
CD
1110
2210
3510
4410
5510
650
7
867
9100
Sheet1


It only worked because there were no 0's showing. Above you'll see both work ok but below because i'm displaying 0's then it would always be showing the zero, so would still be calculating as a result of that being there.

Excel Workbook
CD
11
22
35
44
55
60
7
8 
90
Sheet1
 
Upvote 0
to daffy

on this one the zero was neededl
it is definately not the every case solution.

any complex (or simple) equation can give a wrong answer if an input is other than expected. Blank cells are often an issue, and have often given, and still give, problems. the reason it is blank can be because it is empty, is "" as the result of an equation, the contents hidden, such as not displaying zero or being formatted with ";;;".
Typically each one of these needs to be handled differently in referring formulas.
 
Upvote 0
Because Y20 was looking at the result of a sum, even though there was no numbers in the cells ref'd for the sum, there was a 0 in the box it was just set not to display. a Format trick if you like, but it was still there, so saying if it =0 worked in this case
 
Upvote 0
Wow, these formulas worked great. Thanks for looking into this for me, I appreciate it. It's actually really cool when a spreadsheet does stuff like this :) It's perfect.
 
Upvote 0
Well it seems to still be adding in the number that I have entered in cell AA20. It seems to be acting the same as when I had it figuring up the sum of all of those cells. I see no change.
currently have cell K20 with this formula:

=SUM(Y20,AA20,AC20,AE20,AG20)

The thing is, I don't want it to add up those cells unless I have a number entered in cell Y20. So, if I have numbers in the other cells, but not in cell Y20, then I would like K20 to be left blank. But if I enter a number in cell Y20, then I would like K20 to go ahead and add up all of those cells.

Is that possible without if function?
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,434
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top