How to ignore blank cells with formula!

alinpion

Board Regular
Joined
Jul 12, 2011
Messages
79
Hello!

In cell C1 I hace A1-B1 and in cell DI want to display the status of the cell C1 like this :
=IF(C1<>0 ; "NOT OK" ; "OK")
This means that when the value of the cell C1 is different then 0 cell D1 will display "NOT OK" and if the value of cell c1 is 0 then D1 will display "OK".

The PROBLEM:
Because the cell C1 contains a formula (A1-B1) the D1 cell will display "NOT OK" even if the cell C1 doesn't show any number.
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
Guessing a bit:

C1:
=IF(COUNT(A1:B1)=2,A1-B1,"")

D1:
=IF(C1="","",IF(C1<>0, "NOT OK", "OK"))
 

alinpion

Board Regular
Joined
Jul 12, 2011
Messages
79
How can C1 not show a number? What value is in C1 if not a number - is it an error value?

Cell C1 contains A1-B1
If A1 and B1 are blank then C1 doesn't show any number
If C1 doesn't show any number (keep in mind that C1 contains a formula) D1 will display "NOT OK"

I need a formula for D1 that will ignore the formula in C1 but still compaire C1 with 0.
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707

ADVERTISEMENT

Is that the actual formula you have in C1 or have you simplified it for purposes of the question? The reason I ask is that in all versions of Excel I have used, =A1-B1 will return 0 if A1 and B1 are blank.
 

alinpion

Board Regular
Joined
Jul 12, 2011
Messages
79
Is that the actual formula you have in C1 or have you simplified it for purposes of the question? The reason I ask is that in all versions of Excel I have used, =A1-B1 will return 0 if A1 and B1 are blank.

It is the simplified version ; my actual C cell formula is:

{=IF(AND(NOT(ISBLANK(A2));NOT(ISBLANK(November!B2))); A2-November!B2; "")}
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
It is the simplified version ; my actual C cell formula is:

{=IF(AND(NOT(ISBLANK(A2));NOT(ISBLANK(November!B2))); A2-November!B2; "")}
So, try my D1 formula.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,468
Messages
5,596,307
Members
414,052
Latest member
Dual Showman

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
Top