If Formula

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,971
Office Version
  1. 2019
Platform
  1. Windows
Peace,

what formula that checks cell F2 and cell G2 for 0/blank values.

If both the above cells are 0/blank then give output 0 otherwise give output 1.

Thanks.
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
What type of value would be in the cells if they are not 0/blank ? Text or Number?
 

nuked

Well-known Member
Joined
Mar 20, 2013
Messages
883
This might be better:

=AND((OR(ISBLANK(F2),F2=0)),OR(ISBLANK(G2),G2=0))
 

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,971
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

Numeric.

What type of value would be in the cells if they are not 0/blank ? Text or Number?
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
YES thanks..

Glad to help

Important to note that if the cells have negative numbers, and the sum of those numbers = 0, then you get a false when it should be true.
Example
F2=2
G2=-2
sum(F2:G2)=0, formula results in 0
 

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,971
Office Version
  1. 2019
Platform
  1. Windows
negative may not occur in such an instance. Is number and all positive. thanks again..
 

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,971
Office Version
  1. 2019
Platform
  1. Windows
Dear jommo1,

I needed to say the formula y've posted is running fine however it'd be great if it could output values in " 0 , 1 and 2 "

example "0"

F2 = 0 or blank
G2 = 0 or blank

hence H2 = 0

example "1"

F2 = 50 or any other value except for 0
G2 = 0 or any other value except for 50

hence H2 = 1

example "2"

F2 = 50 or same value as G2 except for 0
G2 = 50 or same value as F2 except for 0

hence H2 = 2

please let me know if further clarification is required. :)
 

Watch MrExcel Video

Forum statistics

Threads
1,123,331
Messages
5,601,002
Members
414,419
Latest member
JRDunya

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