If Formula

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,026
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.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

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
2,026
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
2,026
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
2,026
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. :)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,682
Messages
5,838,784
Members
430,568
Latest member
bortey

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